diff --git a/config/default.js b/config/default.js index 3470e35b..be8f1b6b 100644 --- a/config/default.js +++ b/config/default.js @@ -59,7 +59,7 @@ module.exports = { PROJECTS_API_URL: process.env.PROJECTS_API_URL || 'http://localhost:4000/v5/projects', TERMS_API_URL: process.env.TERMS_API_URL || 'http://localhost:4000/v5/terms', CUSTOMER_PAYMENTS_URL: process.env.CUSTOMER_PAYMENTS_URL || 'https://api.topcoder-dev.com/v5/customer-payments', - CHALLENGE_MIGRATION_APP_URL: process.env.CHALLENGE_MIGRATION_APP_URL || 'https://api.topcoder-dev.com/v5/challenge-migration', + CHALLENGE_MIGRATION_APP_URL: process.env.CHALLENGE_MIGRATION_APP_URL || 'https://api.topcoder.com/v5/challenge-migration', // copilot resource role ids allowed to upload attachment COPILOT_RESOURCE_ROLE_IDS: process.env.COPILOT_RESOURCE_ROLE_IDS ? process.env.COPILOT_RESOURCE_ROLE_IDS.split(',') : ['10ba038e-48da-487b-96e8-8d3b99b6d18b'], diff --git a/src/common/helper.js b/src/common/helper.js index 46f17200..ab60d38b 100644 --- a/src/common/helper.js +++ b/src/common/helper.js @@ -447,7 +447,7 @@ async function createResource (challengeId, memberHandle, roleId) { * @param {String} description The description * @param {String} type The type * @param {String} token The token - * @returns + * @returns */ async function createSelfServiceProject (name, description, type, token) { const projectObj = { diff --git a/src/controllers/ChallengeController.js b/src/controllers/ChallengeController.js index b4c87681..b1d8e133 100644 --- a/src/controllers/ChallengeController.js +++ b/src/controllers/ChallengeController.js @@ -17,11 +17,18 @@ async function searchChallenges (req, res) { // maybe the legacyId is roundId for mm challenge // mm challenge use projectId as legacyId try { + logger.debug(`Staring to get mm challengeId`) const legacyId = await helper.getProjectIdByRoundId(req.query.legacyId) + logger.debug(`Get mm challengeId successfully ${legacyId}`) result = await service.searchChallenges(req.authUser, { ...req.query, ...req.body, legacyId }) + logger.debug(`Get mm challenge successfully`) } catch (e) { logger.debug(`Failed to get projectId with error: ${e.message}`) } + } else { + if (req.query.legacyId) { + logger.debug(`Skipped to get mm challenge`) + } } helper.setResHeaders(req, res, result) res.send(result.result)