Skip to content
This repository was archived by the owner on Jan 23, 2025. It is now read-only.

Commit da8aed9

Browse files
temp hotfix to update the phase status of a live challenge
1 parent ecf9657 commit da8aed9

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/services/ProcessorService.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -89,9 +89,9 @@ async function syncChallengePhases (legacyId, v5Phases, createdBy, isSelfService
8989
// ||
9090
// (v5Equivalent.isOpen && _.toInteger(phase.phase_status_id) === constants.PhaseStatusTypes.Closed) ||
9191
// (!v5Equivalent.isOpen && _.toInteger(phase.phase_status_id) === constants.PhaseStatusTypes.Open)) {
92-
// const newStatus = v5Equivalent.isOpen
93-
// ? constants.PhaseStatusTypes.Open
94-
// : (new Date().getTime() <= new Date(v5Equivalent.scheduledEndDate).getTime() ? constants.PhaseStatusTypes.Scheduled : constants.PhaseStatusTypes.Closed)
92+
const newStatus = v5Equivalent.isOpen
93+
? constants.PhaseStatusTypes.Open
94+
: (new Date().getTime() <= new Date(v5Equivalent.scheduledEndDate).getTime() ? constants.PhaseStatusTypes.Scheduled : constants.PhaseStatusTypes.Closed)
9595
// update phase
9696
logger.debug(`Will update phase ${phaseName}/${v5Equivalent.name} from ${phase.duration} to duration ${v5Equivalent.duration * 1000} milli`)
9797
await timelineService.updatePhase(
@@ -100,7 +100,7 @@ async function syncChallengePhases (legacyId, v5Phases, createdBy, isSelfService
100100
v5Equivalent.scheduledStartDate,
101101
v5Equivalent.scheduledEndDate,
102102
v5Equivalent.duration * 1000,
103-
phase.phase_status_id
103+
newStatus // phase.phase_status_id
104104
)
105105
// newStatus)
106106
// } else {

0 commit comments

Comments
 (0)