Skip to content

Commit 286bce2

Browse files
committed
Update of challenges service to leverage another API problem
unexpected format of submission objects from v3 API for past challenges
1 parent 1aa3e48 commit 286bce2

File tree

3 files changed

+6
-2
lines changed

3 files changed

+6
-2
lines changed

package-lock.json

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
"lint:js": "./node_modules/.bin/eslint --ext .js,.jsx .",
2929
"test": "npm run lint && npm run jest"
3030
},
31-
"version": "0.0.8",
31+
"version": "0.0.9",
3232
"dependencies": {
3333
"isomorphic-fetch": "^2.2.1",
3434
"le_node": "^1.7.0",

src/services/challenges.js

+4
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,10 @@ export function normalizeChallengeDetails(v3, v3Filtered, v3User, username) {
189189
/* Taking winners from v3_filtered, because winners are returned empty in v3 */
190190
/* TODO: Enforced due to problems with /v3/challenge/{ID} endpoint */
191191
challenge.winners = v3Filtered.winners || [];
192+
/* TODO: To compenstate the difference in structure of `submissions`
193+
* in v3 and v3Filetered results (existing code needs v3Filtered version).
194+
*/
195+
challenge.submissions = v3Filtered.submissions || [];
192196
}
193197

194198
// Fill missing data from v3_user

0 commit comments

Comments
 (0)