Skip to content

Commit 035c50c

Browse files
author
Dushyant Bhalgami
committed
added funciton to fetch the registrants
1 parent 6b918dc commit 035c50c

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

Diff for: src/services/challenges.js

+11
Original file line numberDiff line numberDiff line change
@@ -385,6 +385,17 @@ class ChallengesService {
385385
return finalChallenge;
386386
}
387387

388+
/**
389+
* Gets challenge registrants from Topcoder API.
390+
* @param {Number|String} challengeId
391+
* @return {Promise} Resolves to the challenge registrants array.
392+
*/
393+
async getChallengeRegistrants(challengeId) {
394+
const challenge = await this.private.api.get(`/challenges/${challengeId}`)
395+
.then(checkError).then(res => res.content);
396+
return challenge.registrants;
397+
}
398+
388399
/**
389400
* Gets possible challenge subtracks.
390401
* @return {Promise} Resolves to the array of subtrack names.

0 commit comments

Comments
 (0)