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

Commit b69a15c

Browse files
fixes
1 parent 799f059 commit b69a15c

File tree

3 files changed

+7
-9
lines changed

3 files changed

+7
-9
lines changed

src/constants.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,7 @@ const prizeSetTypes = {
77
ChallengePrizes: 'placement',
88
CopilotPayment: 'copilot',
99
ReviewerPayment: 'reviewer',
10-
CheckPoint: 'checkpoint',
11-
SpecReview: 'specReviewer'
10+
CheckPoint: 'checkpoint'
1211
}
1312

1413
const EVENT_ORIGINATOR = 'legacy-challenge-processor'

src/services/ProcessorService.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -691,14 +691,14 @@ async function processUpdate (message) {
691691
try {
692692
// extract metadata from challenge and insert into IFX
693693
for (const metadataKey of _.keys(constants.supportedMetadata)) {
694-
const metaValue = constants.supportedMetadata[metadataKey].method(message.payload, constants.supportedMetadata[metadataKey].defaultValue)
695-
if (metaValue !== null) {
696-
try {
694+
try {
695+
const metaValue = constants.supportedMetadata[metadataKey].method(message.payload, constants.supportedMetadata[metadataKey].defaultValue)
696+
if (metaValue !== null) {
697697
logger.info(`Setting ${constants.supportedMetadata[metadataKey].description} to ${metaValue}`)
698698
await metadataService.createOrUpdateMetadata(legacyId, metadataKey, metaValue, _.get(message, 'payload.updatedBy') || _.get(message, 'payload.createdBy'))
699-
} catch (e) {
700-
logger.warn(`Failed to set ${constants.supportedMetadata[metadataKey].description} to ${metaValue}`)
701699
}
700+
} catch (e) {
701+
logger.warn(`Failed to set ${constants.supportedMetadata[metadataKey].description} to ${metaValue}`)
702702
}
703703
}
704704
// Thomas - get rid of this and add required info directly via IFX

src/utils/metadataExtractor.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
* Metadata extractor
33
*/
44
const _ = require('lodash')
5-
const constants = require('../constants')
65

76
/**
87
* Get metadata entry by key
@@ -53,7 +52,7 @@ function extractSubmissionLimit (challenge, defaultValue) {
5352
* @param {Any} defaultValue the default value
5453
*/
5554
function extractSpecReviewCost (challenge, defaultValue) {
56-
return _.get(_.find(_.get(challenge, 'prizeSets', []), p => p.type === constants.prizeSetTypes.SpecReview) || {}, 'prizes[0].value', defaultValue)
55+
return _.get(_.find(_.get(challenge, 'prizeSets', []), p => p.type === 'specReviewer') || {}, 'prizes[0].value', defaultValue)
5756
}
5857

5958
/**

0 commit comments

Comments
 (0)