Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GQL-89: Honor the linkTypes param when it is nested within GranulesInput params #140

Merged
merged 1 commit into from
Nov 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/cmr/concepts/granule.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ import uniq from 'lodash/uniq'

import Concept from './concept'

import { mergeParams } from '../../utils/mergeParams'

export default class Granule extends Concept {
/**
* Instantiates a Granule object
Expand Down Expand Up @@ -134,7 +136,7 @@ export default class Granule extends Concept {
// eslint-disable-next-line no-param-reassign
item.concept_id = conceptId

const { linkTypes = [] } = this.params
const { linkTypes = [] } = mergeParams(this.params)

// If linkTypes parameter was included and links field was requested, filter the links based on linkTypes
if (linkTypes.length && links.length) {
Expand Down
6 changes: 4 additions & 2 deletions src/datasources/__tests__/granule.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -343,8 +343,10 @@ describe('granule', () => {

const response = await granuleDatasource(
{
collectionConceptId: 'C100000-EDSC',
linkTypes: ['data', 's3']
params: {
collectionConceptId: 'C100000-EDSC',
linkTypes: ['data', 's3']
}
},
{
headers: {
Expand Down