@@ -1165,9 +1165,11 @@ createChallenge.schema = {
1165
1165
tags : Joi . array ( ) . items ( Joi . string ( ) ) , // tag names
1166
1166
projectId : Joi . number ( ) . integer ( ) . positive ( ) ,
1167
1167
legacyId : Joi . number ( ) . integer ( ) . positive ( ) ,
1168
- constraints : Joi . object ( ) . keys ( {
1169
- allowedRegistrants : Joi . array ( ) . items ( Joi . string ( ) ) . optional ( )
1170
- } ) . optional ( ) ,
1168
+ constraints : Joi . object ( )
1169
+ . keys ( {
1170
+ allowedRegistrants : Joi . array ( ) . items ( Joi . string ( ) ) . optional ( ) ,
1171
+ } )
1172
+ . optional ( ) ,
1171
1173
startDate : Joi . date ( ) . iso ( ) ,
1172
1174
status : Joi . string ( ) . valid ( [
1173
1175
constants . challengeStatuses . Active ,
@@ -1994,9 +1996,11 @@ updateChallenge.schema = {
1994
1996
tags : Joi . array ( ) . items ( Joi . string ( ) . required ( ) ) . min ( 1 ) , // tag names
1995
1997
projectId : Joi . number ( ) . integer ( ) . positive ( ) ,
1996
1998
legacyId : Joi . number ( ) . integer ( ) . positive ( ) ,
1997
- constraints : Joi . object ( ) . keys ( {
1998
- allowedRegistrants : Joi . array ( ) . items ( Joi . string ( ) ) . optional ( )
1999
- } ) . optional ( ) ,
1999
+ constraints : Joi . object ( )
2000
+ . keys ( {
2001
+ allowedRegistrants : Joi . array ( ) . items ( Joi . string ( ) ) . optional ( ) ,
2002
+ } )
2003
+ . optional ( ) ,
2000
2004
status : Joi . string ( ) . valid ( _ . values ( constants . challengeStatuses ) ) ,
2001
2005
attachments : Joi . array ( ) . items (
2002
2006
Joi . object ( ) . keys ( {
@@ -2084,6 +2088,7 @@ function sanitizeChallenge(challenge) {
2084
2088
"task" ,
2085
2089
"groups" ,
2086
2090
"cancelReason" ,
2091
+ "constraints" ,
2087
2092
] ) ;
2088
2093
if ( ! _ . isUndefined ( sanitized . name ) ) {
2089
2094
sanitized . name = xss ( sanitized . name ) ;
0 commit comments