Skip to content

Commit 55ceac1

Browse files
temp fix to allow modifications of the timelineTemplateId
1 parent 165312c commit 55ceac1

File tree

1 file changed

+11
-10
lines changed

1 file changed

+11
-10
lines changed

src/services/ChallengeService.js

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1617,16 +1617,17 @@ async function updateChallenge(currentUser, challengeId, data) {
16171617
const finalStatus = data.status || challenge.status;
16181618
const finalTimelineTemplateId = data.timelineTemplateId || challenge.timelineTemplateId;
16191619
const timelineTemplateChanged = false;
1620-
if (!_.get(data, "legacy.pureV5") && !_.get(challenge, "legacy.pureV5")) {
1621-
if (
1622-
finalStatus !== constants.challengeStatuses.New &&
1623-
finalTimelineTemplateId !== challenge.timelineTemplateId
1624-
) {
1625-
throw new errors.BadRequestError(
1626-
`Cannot change the timelineTemplateId for challenges with status: ${finalStatus}`
1627-
);
1628-
}
1629-
} else if (finalTimelineTemplateId !== challenge.timelineTemplateId) {
1620+
// if (!_.get(data, "legacy.pureV5") && !_.get(challenge, "legacy.pureV5")) {
1621+
// if (
1622+
// finalStatus !== constants.challengeStatuses.New &&
1623+
// finalTimelineTemplateId !== challenge.timelineTemplateId
1624+
// ) {
1625+
// throw new errors.BadRequestError(
1626+
// `Cannot change the timelineTemplateId for challenges with status: ${finalStatus}`
1627+
// );
1628+
// }
1629+
// } else
1630+
if (finalTimelineTemplateId !== challenge.timelineTemplateId) {
16301631
// make sure there are no previous phases if the timeline template has changed
16311632
challenge.phases = [];
16321633
timelineTemplateChanged = true;

0 commit comments

Comments
 (0)