Skip to content

Commit 887b387

Browse files
authored
Merge pull request #1519 from topcoder-platform/release_0.20.4
Release 0.20.4
2 parents 9124501 + 62e77d1 commit 887b387

File tree

3 files changed

+19
-4
lines changed

3 files changed

+19
-4
lines changed

src/actions/challenges.js

+4-2
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ import { removeChallengeFromPhaseProduct, saveChallengeAsPhaseProduct } from '..
6565
* @param {string} filterChallengeName
6666
* @param {bool} selfService
6767
* @param {string} userHandle this will be null for admin user(we will return all datas for admin user)
68+
* @param {number} userId this will be null for admin user(we will return all datas for admin user)
6869
* @param {string} filterChallengeType
6970
* @param {object} filterDate
7071
* @param {string} filterSortBy
@@ -79,6 +80,7 @@ export function loadChallengesByPage (
7980
filterChallengeName = null,
8081
selfService = false,
8182
userHandle = null,
83+
userId = 0,
8284
filterChallengeType = {},
8385
filterDate = {},
8486
filterSortBy = null,
@@ -138,8 +140,8 @@ export function loadChallengesByPage (
138140
if (filterSortBy) {
139141
filters['sortBy'] = filterSortBy
140142
}
141-
if (userHandle) {
142-
filters['createdBy'] = userHandle
143+
if (userId) {
144+
filters['memberId'] = userId
143145
}
144146
if (filterSortOrder) {
145147
filters['sortOrder'] = filterSortOrder

src/components/ChallengesComponent/ChallengeList/index.js

+13-1
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,7 @@ class ChallengeList extends Component {
116116
searchText,
117117
selfService,
118118
this.getHandle(),
119+
this.getLoginUserId(),
119120
challengeType,
120121
challengeDate
121122
)
@@ -152,6 +153,7 @@ class ChallengeList extends Component {
152153
searchText,
153154
selfService,
154155
this.getHandle(),
156+
this.getLoginUserId(),
155157
filterChallengeType,
156158
filterDate,
157159
sortBy,
@@ -189,6 +191,7 @@ class ChallengeList extends Component {
189191
searchText,
190192
selfService,
191193
this.getHandle(),
194+
this.getLoginUserId(),
192195
filterChallengeType,
193196
filterDate,
194197
sortBy,
@@ -216,7 +219,8 @@ class ChallengeList extends Component {
216219
status,
217220
searchText,
218221
selfService,
219-
this.getHandle()
222+
this.getHandle(),
223+
this.getLoginUserId()
220224
)
221225
}
222226

@@ -260,6 +264,12 @@ class ChallengeList extends Component {
260264
: null
261265
}
262266

267+
getLoginUserId () {
268+
return this.props.auth && this.props.auth.user
269+
? this.props.auth.user.userId
270+
: null
271+
}
272+
263273
/**
264274
* Hide error message
265275
*/
@@ -294,6 +304,7 @@ class ChallengeList extends Component {
294304
searchText,
295305
selfService,
296306
this.getHandle(),
307+
this.getLoginUserId(),
297308
challengeType,
298309
challengeDate,
299310
name,
@@ -339,6 +350,7 @@ class ChallengeList extends Component {
339350
'',
340351
selfService,
341352
this.getHandle(),
353+
this.getLoginUserId(),
342354
null,
343355
{},
344356
null,

src/containers/Challenges/index.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,8 @@ class Challenges extends Component {
8484
dashboard ? 'all' : '',
8585
'',
8686
selfService,
87-
isAdmin ? null : this.props.auth.user.handle
87+
isAdmin ? null : this.props.auth.user.handle,
88+
this.props.auth.user.userId
8889
)
8990
const projectLoading =
9091
window.localStorage.getItem('projectLoading') !== null

0 commit comments

Comments
 (0)