Skip to content

Commit c4ef25c

Browse files
authored
Merge pull request #516 from yoution/feature/projectid
set CHALLENGE_MIGRATION_APP_URL to prod
2 parents 01caefb + b630baf commit c4ef25c

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

config/default.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ module.exports = {
5959
PROJECTS_API_URL: process.env.PROJECTS_API_URL || 'http://localhost:4000/v5/projects',
6060
TERMS_API_URL: process.env.TERMS_API_URL || 'http://localhost:4000/v5/terms',
6161
CUSTOMER_PAYMENTS_URL: process.env.CUSTOMER_PAYMENTS_URL || 'https://api.topcoder-dev.com/v5/customer-payments',
62-
CHALLENGE_MIGRATION_APP_URL: process.env.CHALLENGE_MIGRATION_APP_URL || 'https://api.topcoder-dev.com/v5/challenge-migration',
62+
CHALLENGE_MIGRATION_APP_URL: process.env.CHALLENGE_MIGRATION_APP_URL || 'https://api.topcoder.com/v5/challenge-migration',
6363
// copilot resource role ids allowed to upload attachment
6464
COPILOT_RESOURCE_ROLE_IDS: process.env.COPILOT_RESOURCE_ROLE_IDS
6565
? process.env.COPILOT_RESOURCE_ROLE_IDS.split(',') : ['10ba038e-48da-487b-96e8-8d3b99b6d18b'],

src/controllers/ChallengeController.js

+7
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,18 @@ async function searchChallenges (req, res) {
1717
// maybe the legacyId is roundId for mm challenge
1818
// mm challenge use projectId as legacyId
1919
try {
20+
logger.debug(`Staring to get mm challengeId`)
2021
const legacyId = await helper.getProjectIdByRoundId(req.query.legacyId)
22+
logger.debug(`Get mm challengeId successfully ${legacyId}`)
2123
result = await service.searchChallenges(req.authUser, { ...req.query, ...req.body, legacyId })
24+
logger.debug(`Get mm challenge successfully`)
2225
} catch (e) {
2326
logger.debug(`Failed to get projectId with error: ${e.message}`)
2427
}
28+
} else {
29+
if (req.query.legacyId) {
30+
logger.debug(`Skipped to get mm challenge`)
31+
}
2532
}
2633
helper.setResHeaders(req, res, result)
2734
res.send(result.result)

0 commit comments

Comments
 (0)