Skip to content
This repository was archived by the owner on Mar 13, 2025. It is now read-only.
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 22b7254

Browse files
committedJan 22, 2021
Hotfix for also assigning copilot fee
1 parent d6f723b commit 22b7254

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed
 

‎services/IssueService.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -494,6 +494,19 @@ async function handleIssueClose(event, issue) { // eslint-disable-line
494494
logger.debugWithContext(`Getting the topcoder member ID for copilot name : ${event.copilot.topcoderUsername}`, event, issue);
495495
// get copilot tc user id
496496
await topcoderApiHelper.addResourceToChallenge(dbIssue.challengeUUID, event.copilot.topcoderUsername, config.ROLE_ID_COPILOT);
497+
const updateBody = {
498+
prizeSets: [{
499+
type: 'placement',
500+
prizes: _.map(issue.prizes, (prize) => ({type: 'USD', value: prize}))
501+
},
502+
{
503+
type: 'copilot',
504+
prizes: [{type: 'USD', value: 40}]
505+
}
506+
]
507+
};
508+
await topcoderApiHelper.updateChallenge(dbIssue.challengeUUID, updateBody);
509+
497510
} else {
498511
logger.debugWithContext('Copilot is already set or the project create copilot payments option is disabled, so skipping', event, issue);
499512
}

0 commit comments

Comments
 (0)