Skip to content

Commit

Permalink
fix: SKFP-779 fix when no family
Browse files Browse the repository at this point in the history
  • Loading branch information
celinepelletier committed Sep 29, 2023
1 parent 10ba659 commit 7984589
Showing 1 changed file with 12 additions and 11 deletions.
23 changes: 12 additions & 11 deletions src/reports/utils/getFamilyIds.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,18 @@ const getFilesInfo = async (fileIds: string[], es: Client): Promise<IFileInfo[]>
const sources = hits.map(hit => hit._source);
const filesInfos = [];
sources.forEach(source => {
source.participants.forEach(participant => {
if (
participant.families_id &&
!filesInfos.find(f => f.families_id === participant.families_id && f.data_type === source.data_type)
) {
filesInfos.push({
data_type: source.data_type,
families_id: participant.families_id || '',
});
}
});
source.participants &&
source.participants.forEach(participant => {
if (
participant.families_id &&
!filesInfos.find(f => f.families_id === participant.families_id && f.data_type === source.data_type)
) {
filesInfos.push({
data_type: source.data_type,
families_id: participant.families_id || '',
});
}
});
});
return filesInfos;
};
Expand Down

0 comments on commit 7984589

Please sign in to comment.