@@ -21,15 +21,16 @@ const { PAGE_SIZE } = CONFIG;
21
21
* loads from the backend at most "limit" data, skipping the first
22
22
* "offset" ones. Returns loaded data as an array.
23
23
* @param {Number } page Optional. Next page of data to load.
24
+ * @param {Number } perPage Optional. The size of the page content to load.
24
25
* @param {Array } prev Optional. data loaded so far.
25
26
*/
26
- function getAll ( getter , page = 1 , prev ) {
27
+ function getAll ( getter , page = 1 , perPage = PAGE_SIZE , prev ) {
27
28
/* Amount of submissions to fetch in one API call. 50 is the current maximum
28
29
* amount of submissions the backend returns, event when the larger limit is
29
30
* explicitely required. */
30
31
return getter ( {
31
32
page,
32
- perPage : PAGE_SIZE ,
33
+ perPage,
33
34
} ) . then ( ( res ) => {
34
35
if ( res . length === 0 ) {
35
36
return prev || res ;
@@ -148,7 +149,8 @@ function getMMSubmissionsDone(challengeId, submitterIds, registrants, tokenV3) {
148
149
const submissionsService = getSubmissionService ( tokenV3 ) ;
149
150
const calls = [
150
151
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 ) ,
152
154
] ;
153
155
return Promise . all ( calls ) . then ( ( [ resources , submissions ] ) => {
154
156
const finalSubmissions = submissionUtil
0 commit comments