Skip to content

Commit 327af77

Browse files
authored
Merge pull request #686 from topcoder-platform/dev
Prod deploy to not require tags
2 parents a032680 + 51b9125 commit 327af77

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

src/services/ChallengeService.js

Lines changed: 3 additions & 7 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) {
@@ -2077,7 +2073,7 @@ updateChallenge.schema = {
20772073
.unknown(true)
20782074
)
20792075
.min(1),
2080-
tags: Joi.array().items(Joi.string().required()).min(1), // tag names
2076+
tags: Joi.array().items(Joi.string()), // tag names
20812077
projectId: Joi.number().integer().positive(),
20822078
legacyId: Joi.number().integer().positive(),
20832079
constraints: Joi.object()

0 commit comments

Comments
 (0)