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

Modify fetch resources from single study to multi-study #5038

Merged
merged 2 commits into from
Nov 5, 2024
Merged
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
17 changes: 10 additions & 7 deletions src/pages/studyView/resources/FilesAndLinks.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,16 +34,19 @@ class FilesLinksTableComponent extends LazyMobXTable<{
const RECORD_LIMIT = 500;

function getResourceDataOfEntireStudy(studyIds: string[]) {
// Only handle the first studyId for now. Can be expanded to make a call per
// studyId.
const studyId = studyIds[0];
const allResources = internalClient.getAllStudyResourceDataInStudyPatientSampleUsingGET(
{
// Fetch resource data for each studyId, then return combined results
const allResources = studyIds.map(studyId =>
internalClient.getAllStudyResourceDataInStudyPatientSampleUsingGET({
studyId: studyId,
projection: 'DETAILED',
}
})
);

return Promise.all(allResources).then(allResources =>
_(allResources)
.flatMap()
.value()
);
return allResources;
}

function getResourceDataOfPatients(studyClinicalData: {
Expand Down
Loading