@@ -146,18 +146,12 @@ class ChallengesService {
146
146
} ;
147
147
const url = `${ endpoint } ?${ qs . stringify ( query ) } ` ;
148
148
const res = await this . private . apiV5 . get ( url ) . then ( checkErrorV5 ) ;
149
- let myChallenges ;
150
- if ( typeof this . private . tokenV3 !== 'undefined' ) {
151
- const { userId } = decodeToken ( this . private . tokenV3 ) ;
152
- myChallenges = await this . private . apiV5 . get ( `/resources/${ userId } /challenges` )
153
- . then ( checkErrorV5 ) . then ( userChallenges => userChallenges ) ;
154
- }
155
149
return {
156
150
challenges : res . result || [ ] ,
157
151
totalCount : res . headers . get ( 'x-total' ) ,
158
152
meta : {
159
153
allChallengesCount : res . headers . get ( 'x-total' ) ,
160
- myChallengesCount : ( myChallenges && myChallenges . headers . get ( 'x-total' ) ) || 0 ,
154
+ myChallengesCount : 0 ,
161
155
ongoingChallengesCount : 0 ,
162
156
openChallengesCount : 0 ,
163
157
totalCount : res . headers . get ( 'x-total' ) ,
@@ -433,16 +427,9 @@ class ChallengesService {
433
427
* @return {Promise } Resolves to the api response.
434
428
*/
435
429
async getChallenges ( filters , params ) {
436
- const memberId = this . private . tokenV3 ? decodeToken ( this . private . tokenV3 ) . userId : null ;
437
- let userChallenges = [ ] ;
438
- if ( memberId ) {
439
- userChallenges = await this . private . apiV5 . get ( `/resources/${ memberId } /challenges` )
440
- . then ( checkErrorV5 ) . then ( res => res . result ) ;
441
- }
442
430
return this . private . getChallenges ( '/challenges/' , filters , params )
443
431
. then ( ( res ) => {
444
- res . challenges . forEach ( item => normalizeChallenge ( item ,
445
- userChallenges . includes ( item . id ) ? memberId : null ) ) ;
432
+ res . challenges . forEach ( item => normalizeChallenge ( item ) ) ;
446
433
return res ;
447
434
} ) ;
448
435
}
0 commit comments