diff --git a/src/services/members.js b/src/services/members.js index 7716c91d..a5b32a51 100644 --- a/src/services/members.js +++ b/src/services/members.js @@ -7,6 +7,7 @@ /* global XMLHttpRequest */ import _ from 'lodash'; import qs from 'qs'; +import { decodeToken } from 'tc-accounts'; import logger from '../utils/logger'; import { getApiResponsePayload } from '../utils/tc'; import { getApi } from './api'; @@ -329,7 +330,8 @@ class MembersService { * @param {Array} challengeId the challenge id */ async getChallengeResources(challengeId) { - const url = `/resources?challengeId=${challengeId}`; + const user = decodeToken(this.private.tokenV3); + const url = `/resources?challengeId=${challengeId}&memberId=${user.userId}`; let res = null; try { @@ -346,14 +348,14 @@ class MembersService { * @param {Array} memberId the member id */ async getUserResources(memberId) { - const url = `/resources/${memberId}/challenges`; + const url = `/challenges?status=Active&memberId=${memberId}`; const res = await this.private.apiV5.get(url); const challenges = await res.json(); const roles = await this.getResourceRoles(); const calls = []; challenges.forEach(async (ch) => { - calls.push(this.getChallengeResources(ch)); + calls.push(this.getChallengeResources(ch.id)); }); return Promise.all(calls).then((resources) => { pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy