Skip to content

Commit

Permalink
Merge pull request #4089 from dippindots/fix-8920
Browse files Browse the repository at this point in the history
Do not fetch structural variants data when there are no applicable samples
  • Loading branch information
alisman authored Dec 14, 2021
2 parents 92842f7 + ab9c6ea commit 4872f7e
Showing 1 changed file with 17 additions and 10 deletions.
27 changes: 17 additions & 10 deletions src/pages/resultsView/ResultsViewPageStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3177,17 +3177,24 @@ export class ResultsViewPageStore
[] as StructuralVariantFilter['sampleMolecularIdentifiers']
);

const data = {
entrezGeneIds: _.map(
this.genes.result,
(gene: Gene) => gene.entrezGeneId
),
sampleMolecularIdentifiers: filters,
} as StructuralVariantFilter;
// filters can be an empty list
// when all selected samples are coming from studies that don't have structural variant profile
// in this case, we should not fetch structural variants data
if (_.isEmpty(filters)) {
return [];
} else {
const data = {
entrezGeneIds: _.map(
this.genes.result,
(gene: Gene) => gene.entrezGeneId
),
sampleMolecularIdentifiers: filters,
} as StructuralVariantFilter;

return await client.fetchStructuralVariantsUsingPOST({
structuralVariantFilter: data,
});
return await client.fetchStructuralVariantsUsingPOST({
structuralVariantFilter: data,
});
}
},
});

Expand Down

0 comments on commit 4872f7e

Please sign in to comment.