fix: 🐛 Check merge key for merge data source (#3901)

This commit is contained in:
Igor Octaviano 2024-01-17 12:51:49 -03:00 committed by GitHub
parent 9c553fded4
commit 911d672835
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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;
};
/**