Skip to content

Commit d294d4a

Browse files
committed
Fix to show all challenges inside a project, instead of using memberId when the projectId is set
https://topcoder.atlassian.net/browse/LVT-97
1 parent 03c8277 commit d294d4a

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/actions/challenges.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -140,9 +140,6 @@ export function loadChallengesByPage (
140140
if (filterSortBy) {
141141
filters['sortBy'] = filterSortBy
142142
}
143-
if (userId) {
144-
filters['memberId'] = userId
145-
}
146143
if (filterSortOrder) {
147144
filters['sortOrder'] = filterSortOrder
148145
}
@@ -153,6 +150,10 @@ export function loadChallengesByPage (
153150
filters['projectId'] = projectId
154151
} else if (_.isObject(projectId) && projectId.value > 0) {
155152
filters['projectId'] = projectId.value
153+
} else if (userId) {
154+
// Note that we only add the memberId field if *no* project ID is given,
155+
// so that the list of *all challenges shows only those that the member is on
156+
filters['memberId'] = userId
156157
}
157158

158159
if (status === 'all') {

0 commit comments

Comments
 (0)