Skip to content

Commit

Permalink
Remove unnecessary Map instantiation
Browse files Browse the repository at this point in the history
  • Loading branch information
hweej committed Oct 31, 2024
1 parent f8aff81 commit 07f04bb
Showing 1 changed file with 2 additions and 12 deletions.
14 changes: 2 additions & 12 deletions src/pages/studyView/resources/FilesAndLinks.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import {
getSampleViewUrlWithPathname,
getPatientViewUrlWithPathname,
} from 'shared/api/urls';
import { getAllClinicalDataByStudyViewFilter } from '../StudyViewUtils';
import { StudyViewPageStore } from 'pages/studyView/StudyViewPageStore';
import { isUrl, remoteData } from 'cbioportal-frontend-commons';
import { makeObservable, observable, computed } from 'mobx';
Expand Down Expand Up @@ -116,23 +115,14 @@ async function fetchFilesLinksData(
sortDirection: 'asc' | 'desc' | undefined,
recordLimit: number
) {
const studyClinicalDataResponse = await getAllClinicalDataByStudyViewFilter(
filters,
searchTerm,
sortAttributeId,
sortDirection,
recordLimit,
0
);

const selectedStudyIds = [
...new Set(selectedSamples.map(item => item.studyId)),
];

// sampleIds (+patientIds) for the selectedSamples
const selectedIds = new Map([
...new Map(selectedSamples.map(item => [item.sampleId, item.studyId])),
...new Map(selectedSamples.map(item => [item.patientId, item.studyId])),
...selectedSamples.map(item => [item.sampleId, item.studyId] as const),
...selectedSamples.map(item => [item.patientId, item.studyId] as const),
]);

// Fetch resources for entire study
Expand Down

0 comments on commit 07f04bb

Please sign in to comment.