Skip to content

Commit

Permalink
No merge array existence check before parsing the suggestion query (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
epipav authored Oct 10, 2023
1 parent 4fe2ba0 commit 44519b3
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions backend/src/database/repositories/organizationRepository.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1237,12 +1237,17 @@ class OrganizationRepository {
}
}

for (const noMergeId of organization._source.uuid_arr_noMergeIds) {
identitiesPartialQuery.must_not.push({
term: {
uuid_organizationId: noMergeId,
},
})
if (
organization._source.uuid_arr_noMergeIds &&
organization._source.uuid_arr_noMergeIds.length > 0
) {
for (const noMergeId of organization._source.uuid_arr_noMergeIds) {
identitiesPartialQuery.must_not.push({
term: {
uuid_organizationId: noMergeId,
},
})
}
}

const sameOrganizationsQueryBody = {
Expand Down

0 comments on commit 44519b3

Please sign in to comment.