Skip to content

Commit

Permalink
Merge pull request #317 from topcoder-platform/develop
Browse files Browse the repository at this point in the history
Release v1.2.1
  • Loading branch information
luizrrodrigues authored Oct 7, 2021
2 parents db9b9a9 + d5e1b2b commit beeb40c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
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": "1.2.0",
"version": "1.2.1",
"dependencies": {
"auth0-js": "^6.8.4",
"config": "^3.2.0",
Expand Down
9 changes: 6 additions & 3 deletions src/services/challenges.js
Original file line number Diff line number Diff line change
Expand Up @@ -453,12 +453,15 @@ class ChallengesService {
*/
async getChallengeRegistrants(challengeId) {
/* If no token provided, resource will return Submitter role only */
const roleId = this.private.tokenV3 ? await this.getRoleId('Submitter') : '';
const params = {
const roleId = this.private.tokenV3 ? await this.getRoleId('Submitter') : null;
let params = {
challengeId,
roleId,
};

if (roleId) {
params = { ...params, roleId };
}

let registrants = await this.private.apiV5.get(`/resources?${qs.stringify(params)}`)
.then(checkErrorV5).then(res => res.result);

Expand Down

0 comments on commit beeb40c

Please sign in to comment.