Skip to content

Commit 37b2512

Browse files
temp fix for challenge type
1 parent a46f77f commit 37b2512

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

src/services/ChallengeService.js

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -402,10 +402,16 @@ async function getChallenge (currentUser, id) {
402402
}
403403
// check groups authorization
404404
await ensureAccessibleByGroupsAccess(currentUser, challenge)
405-
405+
// FIXME: Temporarily hard coded as the migrad
406406
// populate type property based on the typeId
407-
const type = await helper.getById('ChallengeType', challenge.typeId)
408-
challenge.type = type.name
407+
try {
408+
const type = await helper.getById('ChallengeType', challenge.typeId)
409+
challenge.type = type.name
410+
} catch (e) {
411+
challenge.typeId = '45415132-79fa-4d13-a9ac-71f50020dc10'
412+
const type = await helper.getById('ChallengeType', challenge.typeId)
413+
challenge.type = type.name
414+
}
409415
// delete challenge.typeId
410416

411417
// Remove privateDescription for unregistered users

0 commit comments

Comments
 (0)