Skip to content

Fix getChallengeRegistrants filter to not logged user #223

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 6 commits into
base: integration-v5-challenge-api
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Fix getChallengeRegistrants filter to not logged user
  • Loading branch information
luizrrodrigues committed Aug 14, 2020
commit 12cf31e5940095dc688aadb2f78c39525917e19a
4 changes: 3 additions & 1 deletion src/services/challenges.js
Original file line number Diff line number Diff line change
Expand Up @@ -407,7 +407,9 @@ class ChallengesService {
.then(checkErrorV5).then(res => res.result);

/* API will return all roles to currentUser, so need to filter in FE */
registrants = _.filter(registrants, r => r.roleId === roleId);
if (roleId) {
registrants = _.filter(registrants, r => r.roleId === roleId);
}

return registrants || [];
}
Expand Down