Skip to content

Commit 7ebd316

Browse files
Increase the perPage for loading challenge submissions to 500
1 parent 1adf020 commit 7ebd316

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
"lint:js": "./node_modules/.bin/eslint --ext .js,.jsx .",
3232
"test": "npm run lint && npm run jest"
3333
},
34-
"version": "0.7.11-2",
34+
"version": "0.7.11-3",
3535
"dependencies": {
3636
"auth0-js": "^6.8.4",
3737
"config": "^3.2.0",

src/actions/challenge.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,16 @@ const { PAGE_SIZE } = CONFIG;
2121
* loads from the backend at most "limit" data, skipping the first
2222
* "offset" ones. Returns loaded data as an array.
2323
* @param {Number} page Optional. Next page of data to load.
24+
* @param {Number} perPage Optional. The size of the page content to load.
2425
* @param {Array} prev Optional. data loaded so far.
2526
*/
26-
function getAll(getter, page = 1, prev) {
27+
function getAll(getter, page = 1, perPage = PAGE_SIZE, prev) {
2728
/* Amount of submissions to fetch in one API call. 50 is the current maximum
2829
* amount of submissions the backend returns, event when the larger limit is
2930
* explicitely required. */
3031
return getter({
3132
page,
32-
perPage: PAGE_SIZE,
33+
perPage,
3334
}).then((res) => {
3435
if (res.length === 0) {
3536
return prev || res;
@@ -148,7 +149,8 @@ function getMMSubmissionsDone(challengeId, submitterIds, registrants, tokenV3) {
148149
const submissionsService = getSubmissionService(tokenV3);
149150
const calls = [
150151
memberService.getMembersInformation(submitterIds),
151-
getAll(params => submissionsService.getSubmissions(filter, params)),
152+
// TODO: Move those numbers to configs
153+
getAll(params => submissionsService.getSubmissions(filter, params), 1, 500),
152154
];
153155
return Promise.all(calls).then(([resources, submissions]) => {
154156
const finalSubmissions = submissionUtil

0 commit comments

Comments
 (0)