Skip to content

Commit f596869

Browse files
committed
Debugging and fixing
1 parent 1b390fe commit f596869

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

services/IssueService.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -383,9 +383,11 @@ async function handleIssueClose(event, issue) {
383383
comment += ' please reopen it, add the ```' + config.FIX_ACCEPTED_ISSUE_LABEL + '``` label, and then close it again';// eslint-disable-line
384384
await gitHelper.createComment(event, issue.number, comment);
385385
closeChallenge = true;
386+
return;
386387
}
387388
if (issue.prizes[0] === 0) {
388389
closeChallenge = true;
390+
return;
389391
}
390392

391393
// if issue is closed without assignee then do nothing
@@ -429,6 +431,10 @@ async function handleIssueClose(event, issue) {
429431
logger.debug(`Getting the topcoder member ID for member name: ${assigneeMember.topcoderUsername}`);
430432
const winnerId = await topcoderApiHelper.getTopcoderMemberId(assigneeMember.topcoderUsername);
431433

434+
resources = await topcoderApiHelper.getResourcesFromChallenge(dbIssue.challengeId)
435+
436+
logger.debug(`Existing resources: ${resources}`);
437+
432438
logger.debug(`Getting the topcoder member ID for copilot name : ${event.copilot.topcoderUsername}`);
433439
// get copilot tc user id
434440
const copilotTopcoderUserId = await topcoderApiHelper.getTopcoderMemberId(event.copilot.topcoderUsername);
@@ -442,7 +448,6 @@ async function handleIssueClose(event, issue) {
442448
addForumWatch: true
443449
};
444450
await topcoderApiHelper.addResourceToChallenge(dbIssue.challengeId, copilotResourceBody);
445-
446451
// adding reg
447452
await topcoderApiHelper.assignUserAsRegistrant(winnerId, dbIssue.challengeId);
448453

0 commit comments

Comments
 (0)