Skip to content

Commit

Permalink
Merge pull request #98 from topcoder-platform/fetch-registrants
Browse files Browse the repository at this point in the history
Fetch registrants
  • Loading branch information
Dushyant Bhalgami authored Oct 9, 2019
2 parents 6b918dc + 27001a9 commit da86320
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
"lint:js": "./node_modules/.bin/eslint --ext .js,.jsx .",
"test": "npm run lint && npm run jest"
},
"version": "0.8.1",
"version": "0.8.2",
"dependencies": {
"auth0-js": "^6.8.4",
"config": "^3.2.0",
Expand Down
11 changes: 11 additions & 0 deletions src/services/challenges.js
Original file line number Diff line number Diff line change
Expand Up @@ -385,6 +385,17 @@ class ChallengesService {
return finalChallenge;
}

/**
* Gets challenge registrants from Topcoder API.
* @param {Number|String} challengeId
* @return {Promise} Resolves to the challenge registrants array.
*/
async getChallengeRegistrants(challengeId) {
const challenge = await this.private.api.get(`/challenges/${challengeId}`)
.then(checkError).then(res => res.content);
return challenge.registrants;
}

/**
* Gets possible challenge subtracks.
* @return {Promise} Resolves to the array of subtrack names.
Expand Down

0 comments on commit da86320

Please sign in to comment.