Skip to content

Commit b3bd699

Browse files
authored
Merge pull request #198 from nursoltan-s/issue-4559
fix #4559
2 parents bd5d00d + b6ae625 commit b3bd699

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

src/services/challenges.js

+10
Original file line numberDiff line numberDiff line change
@@ -517,6 +517,16 @@ class ChallengesService {
517517
};
518518
}
519519

520+
/**
521+
* Gets user resources.
522+
* @param {String} userId User id whose challenges we want to fetch.
523+
* @return {Promise} Resolves to the api response.
524+
*/
525+
async getUserResources(userId) {
526+
const res = await this.private.apiV5.get(`/resources/${userId}/challenges`);
527+
return res.json();
528+
}
529+
520530
/**
521531
* Gets marathon matches of the specified user.
522532
* @param {String} memberId User whose challenges we want to fetch.

src/utils/challenge/filter.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -173,8 +173,8 @@ function filterByUpcoming(challenge, state) {
173173
}
174174

175175
function filterByUsers(challenge, state) {
176-
if (!state.users) return true;
177-
return state.users.find(user => challenge.users[user]);
176+
if (!state.userChallenges) return true;
177+
return state.userChallenges.find(ch => challenge.id === ch);
178178
}
179179

180180
/**

0 commit comments

Comments
 (0)