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

Commit a5f5e7e

Browse files
Hardcode TASK to FIRST_2_FINISH
1 parent 1f7c37e commit a5f5e7e

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

src/constants.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,16 @@ const challengeStatuses = {
4545
CancelledZeroRegistrations: 'Cancelled - Zero Registrations'
4646
}
4747

48+
const challengeAbbreviations = {
49+
TASK: 'TASK',
50+
FIRST_2_FINISH: 'FIRST_2_FINISH'
51+
}
52+
4853
module.exports = {
4954
prizeSetTypes,
5055
EVENT_ORIGINATOR,
5156
EVENT_MIME_TYPE,
5257
createChallengeStatusesMap,
53-
challengeStatuses
58+
challengeStatuses,
59+
challengeAbbreviations
5460
}

src/services/ProcessorService.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,10 @@ async function parsePayload (payload, m2mToken, isCreated = true) {
9797
if (payload.typeId) {
9898
const typeRes = await helper.getRequest(`${config.V5_CHALLENGE_TYPE_API_URL}/${payload.typeId}`, m2mToken)
9999
data.subTrack = typeRes.body.abbreviation // FIXME: thomas
100+
// TASK is named as FIRST_2_FINISH on legacy
101+
if (data.subTrack === constants.challengeAbbreviations.TASK) {
102+
data.subTrack = constants.challengeAbbreviations.FIRST_2_FINISH
103+
}
100104
data.legacyTypeId = typeRes.body.legacyId
101105
}
102106
if (payload.description) {

0 commit comments

Comments
 (0)