Skip to content

Commit da86320

Browse files
author
Dushyant Bhalgami
authored
Merge pull request #98 from topcoder-platform/fetch-registrants
Fetch registrants
2 parents 6b918dc + 27001a9 commit da86320

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

Diff for: package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
"lint:js": "./node_modules/.bin/eslint --ext .js,.jsx .",
3232
"test": "npm run lint && npm run jest"
3333
},
34-
"version": "0.8.1",
34+
"version": "0.8.2",
3535
"dependencies": {
3636
"auth0-js": "^6.8.4",
3737
"config": "^3.2.0",

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)