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

Commit ad8b7cf

Browse files
authored
Merge branch 'topcoder-platform:develop' into develop
2 parents 6c25476 + e309ee3 commit ad8b7cf

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

utils/topcoder-api-helper.js

+3-5
Original file line numberDiff line numberDiff line change
@@ -171,10 +171,8 @@ async function activateChallenge(id) {
171171
async function applySkillsSetToChallenge(challengeId, tags) {
172172
const apiKey = await getM2Mtoken();
173173
logger.debug(`Applying skills set to the challenge ${challengeId}`);
174-
const url = `${config.TC_API_URL}/standardized-skills/work-skills`;
174+
const url = `${config.TC_API_URL}/standardized-skills/challenge-skills/${challengeId}`;
175175
const payload = {
176-
workId: challengeId,
177-
workTypeId: config.WORK_TYPE_ID,
178176
skillIds: tags.map((tag) => tag.id)
179177
};
180178
const params = {
@@ -186,12 +184,12 @@ async function applySkillsSetToChallenge(challengeId, tags) {
186184
try {
187185
const response = await axios.post(url, payload, params);
188186
const statusCode = response.status ? response.status : null;
189-
loggerFile.info(`EndPoint: POST /standardized-skills/work-skills,
187+
loggerFile.info(`EndPoint: POST /standardized-skills/challenge-skills/${challengeId},
190188
POST parameters: ${circularJSON.stringify(payload)}, Status Code:${statusCode}, Response: ${circularJSON.stringify(response.data)}`);
191189
logger.debug(`Skills set applied successfully to the challenge ${challengeId}`);
192190
return response.data;
193191
} catch (err) {
194-
loggerFile.info(`EndPoint: POST /standardized-skills/work-skills, POST parameters: ${circularJSON.stringify(payload)}, Status Code:null,
192+
loggerFile.info(`EndPoint: POST /standardized-skills/challenge-skills/${challengeId}, POST parameters: ${circularJSON.stringify(payload)}, Status Code:null,
195193
Error: 'Failed to apply skills set to the challenge.', Details: ${circularJSON.stringify(err)}`);
196194
logger.error(`Response Data: ${JSON.stringify(err.response.data)}`);
197195
throw errors.convertTopcoderApiError(err, 'Failed to apply skills set to the challenge.');

0 commit comments

Comments
 (0)