Skip to content

Commit

Permalink
GQL-89: Honor the linkTypes param when it is nested within GranulesIn…
Browse files Browse the repository at this point in the history
…put params
  • Loading branch information
macrouch committed Nov 5, 2024
1 parent 5ee0fb5 commit e9bcdc0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
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

0 comments on commit e9bcdc0

Please sign in to comment.