File tree 1 file changed +6
-2
lines changed
1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -399,14 +399,18 @@ class ChallengesService {
399
399
*/
400
400
async getChallengeRegistrants ( challengeId ) {
401
401
/* If no token provided, resource will return Submitter role only */
402
+ const roleId = this . private . tokenV3 ? await this . getRoleId ( 'Submitter' ) : '' ;
402
403
const params = {
403
404
challengeId,
404
- roleId : this . private . tokenV3 ? await this . getRoleId ( 'Submitter' ) : '' ,
405
+ roleId,
405
406
} ;
406
407
407
- const registrants = await this . private . apiV5 . get ( `/resources?${ qs . stringify ( params ) } ` )
408
+ let registrants = await this . private . apiV5 . get ( `/resources?${ qs . stringify ( params ) } ` )
408
409
. then ( checkErrorV5 ) . then ( res => res . result ) ;
409
410
411
+ /* API will return all roles to currentUser, so need to filter in FE */
412
+ registrants = _ . filter ( registrants , r => r . roleId === roleId ) ;
413
+
410
414
return registrants || [ ] ;
411
415
}
412
416
You can’t perform that action at this time.
0 commit comments