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

Commit cc222bd

Browse files
Fix fetching challenge from ES
1 parent 46fbe20 commit cc222bd

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/services/ProcessorService.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,7 @@ async function processUpdate (message) {
303303
if (message.payload.status === constants.challengeStatuses.Completed && challenge.currentStatus !== constants.challengeStatuses.Completed) {
304304
const challengeUuid = message.payload.id
305305
const v5Challenge = await helper.getRequest(`${config.V5_CHALLENGE_API_URL}/${challengeUuid}`, m2mToken)
306-
if (v5Challenge.typeId === config.TASK_TYPE_ID) {
306+
if (v5Challenge.body.typeId === config.TASK_TYPE_ID) {
307307
logger.info('Challenge type is TASK')
308308
if (!message.payload.winners || message.payload.winners.length === 0) {
309309
throw new Error('Cannot close challenge without winners')
@@ -312,7 +312,7 @@ async function processUpdate (message) {
312312
logger.info(`Will close the challenge with ID ${message.payload.legacyId}. Winner ${winnerId}!`)
313313
await closeChallenge(message.payload.legacyId, winnerId)
314314
} else {
315-
logger.info(`Challenge type is ${v5Challenge.typeId}.. Skip closing challenge...`)
315+
logger.info(`Challenge type is ${v5Challenge.body.typeId}.. Skip closing challenge...`)
316316
}
317317
}
318318
}

0 commit comments

Comments
 (0)