Skip to content

Commit 5f95820

Browse files
committed
Merge remote-tracking branch 'origin/dev' into PLAT-3491
2 parents 2dd47f6 + e9b1e32 commit 5f95820

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

src/services/ChallengeService.js

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -533,16 +533,12 @@ async function searchChallenges(currentUser, criteria) {
533533
mustNotQuery.push({ exists: { field: "groups" } });
534534
} else if (!currentUser.isMachine && !_hasAdminRole) {
535535
// If the user is not M2M and is not an admin, return public + challenges from groups the user can access
536-
_.each(accessibleGroups, (g) => {
537-
groupsQuery.push({ match_phrase: { groups: g } });
538-
});
536+
groupsQuery.push({ terms: { "groups.keyword": accessibleGroups } });
539537
// include public challenges
540538
groupsQuery.push({ bool: { must_not: { exists: { field: "groups" } } } });
541539
}
542540
} else {
543-
_.each(groupsToFilter, (g) => {
544-
groupsQuery.push({ match_phrase: { groups: g } });
545-
});
541+
groupsQuery.push({ terms: { "groups.keyword": groupsToFilter } });
546542
}
547543

548544
if (criteria.ids) {

0 commit comments

Comments
 (0)