@@ -1494,6 +1494,7 @@ async function updateChallenge(currentUser, challengeId, data) {
1494
1494
1495
1495
// Remove fields from data that are not allowed to be updated and that match the existing challenge
1496
1496
data = sanitizeData ( sanitizeChallenge ( data ) , challenge ) ;
1497
+ console . debug ( 'Sanitized Data:' , data ) ;
1497
1498
1498
1499
validateChallengeUpdateRequest ( currentUser , challenge , data ) ;
1499
1500
@@ -1738,7 +1739,6 @@ async function updateChallenge(currentUser, challengeId, data) {
1738
1739
}
1739
1740
1740
1741
data . phases = newPhases ;
1741
- challenge . phases = newPhases ;
1742
1742
data . startDate = newStartDate ;
1743
1743
data . endDate = helper . calculateChallengeEndDate ( challenge , data ) ;
1744
1744
}
@@ -1982,7 +1982,7 @@ updateChallenge.schema = {
1982
1982
typeId : Joi . optionalId ( ) ,
1983
1983
name : Joi . string ( ) . optional ( ) ,
1984
1984
description : Joi . string ( ) . optional ( ) ,
1985
- privateDescription : Joi . string ( ) . optional ( ) ,
1985
+ privateDescription : Joi . string ( ) . allow ( '' ) . optional ( ) ,
1986
1986
descriptionFormat : Joi . string ( ) . optional ( ) ,
1987
1987
metadata : Joi . array ( )
1988
1988
. items (
@@ -2188,8 +2188,6 @@ function sanitizeChallenge(challenge) {
2188
2188
_ . pick ( phase , [
2189
2189
"phaseId" ,
2190
2190
"duration" ,
2191
- "isOpen" ,
2192
- "actualEndDate" ,
2193
2191
"scheduledStartDate" ,
2194
2192
"constraints" ,
2195
2193
] )
0 commit comments