File tree 1 file changed +5
-3
lines changed
1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change 7
7
/* global XMLHttpRequest */
8
8
import _ from 'lodash' ;
9
9
import qs from 'qs' ;
10
+ import { decodeToken } from 'tc-accounts' ;
10
11
import logger from '../utils/logger' ;
11
12
import { getApiResponsePayload } from '../utils/tc' ;
12
13
import { getApi } from './api' ;
@@ -329,7 +330,8 @@ class MembersService {
329
330
* @param {Array } challengeId the challenge id
330
331
*/
331
332
async getChallengeResources ( challengeId ) {
332
- const url = `/resources?challengeId=${ challengeId } ` ;
333
+ const user = decodeToken ( this . private . tokenV3 ) ;
334
+ const url = `/resources?challengeId=${ challengeId } &memberId=${ user . userId } ` ;
333
335
let res = null ;
334
336
335
337
try {
@@ -346,14 +348,14 @@ class MembersService {
346
348
* @param {Array } memberId the member id
347
349
*/
348
350
async getUserResources ( memberId ) {
349
- const url = `/resources/ ${ memberId } /challenges ` ;
351
+ const url = `/challenges?status=Active&memberId= ${ memberId } ` ;
350
352
const res = await this . private . apiV5 . get ( url ) ;
351
353
const challenges = await res . json ( ) ;
352
354
const roles = await this . getResourceRoles ( ) ;
353
355
const calls = [ ] ;
354
356
355
357
challenges . forEach ( async ( ch ) => {
356
- calls . push ( this . getChallengeResources ( ch ) ) ;
358
+ calls . push ( this . getChallengeResources ( ch . id ) ) ;
357
359
} ) ;
358
360
359
361
return Promise . all ( calls ) . then ( ( resources ) => {
You can’t perform that action at this time.
0 commit comments