From 1499985f128d1409818aebe70e8ddc54a6f93a91 Mon Sep 17 00:00:00 2001 From: "Luiz R. Rodrigues" Date: Wed, 21 Oct 2020 15:08:06 -0300 Subject: [PATCH 1/2] Remove token from v2 calls (checkpoint and results) --- src/actions/challenge.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/actions/challenge.js b/src/actions/challenge.js index a2d538ab..86655807 100644 --- a/src/actions/challenge.js +++ b/src/actions/challenge.js @@ -248,7 +248,7 @@ function loadResultsInit(challengeId) { * @return {Action} */ function loadResultsDone(auth, challengeId, type) { - return getApi('V2', auth.tokenV2) + return getApi('V2') .fetch(`/${type}/challenges/result/${challengeId}`) .then(response => response.json()) .then(response => ({ @@ -273,7 +273,7 @@ function fetchCheckpointsInit() {} */ function fetchCheckpointsDone(tokenV2, challengeId) { const endpoint = `/design/challenges/checkpoint/${challengeId}`; - return getApi('V2', tokenV2).fetch(endpoint) + return getApi('V2').fetch(endpoint) .then((response) => { if (response.status !== 200) { throw response.status; From f12d6d638a2eea413fbc582050a27eda4e289897 Mon Sep 17 00:00:00 2001 From: "Luiz R. Rodrigues" Date: Wed, 21 Oct 2020 15:08:55 -0300 Subject: [PATCH 2/2] Fix checkpoint challengeId comparation --- src/reducers/challenge.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/reducers/challenge.js b/src/reducers/challenge.js index e706cb07..7dde8670 100644 --- a/src/reducers/challenge.js +++ b/src/reducers/challenge.js @@ -173,7 +173,7 @@ function onFetchCheckpointsDone(state, action) { loadingCheckpoints: false, }; } - if (state.details && state.details.legacyId === action.payload.challengeId) { + if (state.details && `${state.details.legacyId}` === `${action.payload.challengeId}`) { return { ...state, checkpoints: action.payload.checkpoints,