Skip to content

Commit

Permalink
fix: 🐛 Check merge key for merge data source (OHIF#3901)
Browse files Browse the repository at this point in the history
  • Loading branch information
igoroctaviano authored and thanh-nguyen-dang committed Apr 30, 2024
1 parent 0a52832 commit 15d3bcc
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion extensions/default/src/MergeDataSource/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,14 @@ export const callForAllDataSourcesAsync = async ({

await Promise.allSettled(promises);

return uniqBy(mergedData.flat(), obj => obj[mergeKey]);
let results = [];
if (mergeKey) {
results = uniqBy(mergedData.flat(), obj => get(obj, mergeKey));
} else {
results = mergedData.flat();
}

return results;
};

/**
Expand Down

0 comments on commit 15d3bcc

Please sign in to comment.