Skip to content

set CHALLENGE_MIGRATION_APP_URL to prod #516

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 12, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion config/default.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'],
Expand Down
2 changes: 1 addition & 1 deletion src/common/helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down
7 changes: 7 additions & 0 deletions src/controllers/ChallengeController.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down