File tree 1 file changed +3
-7
lines changed 1 file changed +3
-7
lines changed Original file line number Diff line number Diff line change @@ -533,16 +533,12 @@ async function searchChallenges(currentUser, criteria) {
533
533
mustNotQuery . push ( { exists : { field : "groups" } } ) ;
534
534
} else if ( ! currentUser . isMachine && ! _hasAdminRole ) {
535
535
// 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 } } ) ;
539
537
// include public challenges
540
538
groupsQuery . push ( { bool : { must_not : { exists : { field : "groups" } } } } ) ;
541
539
}
542
540
} else {
543
- _ . each ( groupsToFilter , ( g ) => {
544
- groupsQuery . push ( { match_phrase : { groups : g } } ) ;
545
- } ) ;
541
+ groupsQuery . push ( { terms : { "groups.keyword" : groupsToFilter } } ) ;
546
542
}
547
543
548
544
if ( criteria . ids ) {
@@ -2077,7 +2073,7 @@ updateChallenge.schema = {
2077
2073
. unknown ( true )
2078
2074
)
2079
2075
. min ( 1 ) ,
2080
- tags : Joi . array ( ) . items ( Joi . string ( ) . required ( ) ) . min ( 1 ) , // tag names
2076
+ tags : Joi . array ( ) . items ( Joi . string ( ) ) , // tag names
2081
2077
projectId : Joi . number ( ) . integer ( ) . positive ( ) ,
2082
2078
legacyId : Joi . number ( ) . integer ( ) . positive ( ) ,
2083
2079
constraints : Joi . object ( )
You can’t perform that action at this time.
0 commit comments