Skip to content

Commit 99c8645

Browse files
authored
Merge pull request #573 from topcoder-platform/fix/phase-update
fix: phase update object
2 parents 06578d3 + 80a4689 commit 99c8645

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/services/ChallengeService.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1494,6 +1494,7 @@ async function updateChallenge(currentUser, challengeId, data) {
14941494

14951495
// Remove fields from data that are not allowed to be updated and that match the existing challenge
14961496
data = sanitizeData(sanitizeChallenge(data), challenge);
1497+
console.debug('Sanitized Data:', data);
14971498

14981499
validateChallengeUpdateRequest(currentUser, challenge, data);
14991500

@@ -1738,7 +1739,6 @@ async function updateChallenge(currentUser, challengeId, data) {
17381739
}
17391740

17401741
data.phases = newPhases;
1741-
challenge.phases = newPhases;
17421742
data.startDate = newStartDate;
17431743
data.endDate = helper.calculateChallengeEndDate(challenge, data);
17441744
}
@@ -1982,7 +1982,7 @@ updateChallenge.schema = {
19821982
typeId: Joi.optionalId(),
19831983
name: Joi.string().optional(),
19841984
description: Joi.string().optional(),
1985-
privateDescription: Joi.string().optional(),
1985+
privateDescription: Joi.string().allow('').optional(),
19861986
descriptionFormat: Joi.string().optional(),
19871987
metadata: Joi.array()
19881988
.items(
@@ -2188,8 +2188,6 @@ function sanitizeChallenge(challenge) {
21882188
_.pick(phase, [
21892189
"phaseId",
21902190
"duration",
2191-
"isOpen",
2192-
"actualEndDate",
21932191
"scheduledStartDate",
21942192
"constraints",
21952193
])

0 commit comments

Comments
 (0)