@@ -111,12 +111,13 @@ public function failure(array $context = [])
111
111
* @param SS_List $list
112
112
* @param callable $keyFunc
113
113
* @param callable $dataFunc
114
+ * @param int $pageLength
114
115
*
115
116
* @return HTTPResponse
116
117
*/
117
- public function returnPaginated (SS_List $ list , $ keyFunc = null , $ dataFunc = null )
118
+ public function returnPaginated (SS_List $ list , $ keyFunc = null , $ dataFunc = null , $ pageLength = 100 )
118
119
{
119
- list ($ list , $ output ) = $ this ->prepPaginatedOutput ($ list , $ keyFunc , $ dataFunc );
120
+ list ($ list , $ output ) = $ this ->prepPaginatedOutput ($ list , $ keyFunc , $ dataFunc, $ pageLength );
120
121
121
122
return $ this ->returnArray ([
122
123
'records ' => $ output ,
@@ -227,7 +228,8 @@ public function ensureUserLoggedIn($permissionCodes = [])
227
228
$ token = JWT ::decode (
228
229
$ this ->getJwt (),
229
230
Config::inst ()->get (JWTUtils::class, 'secret ' ),
230
- ['HS256 ' ]);
231
+ ['HS256 ' ]
232
+ );
231
233
232
234
$ member = Member::get ()->byID ($ token ->memberId );
233
235
@@ -392,12 +394,12 @@ public function ensureVars(array $vars = [])
392
394
foreach ($ vars as $ k => $ v ) {
393
395
if ($ v && is_callable ($ v )) {
394
396
if (!$ this ->hasVar ($ k ) || !$ v ($ this ->getVar ($ k ))) {
395
- throw $ this ->httpError (400 , 'Missing required variable: ' . $ v );
397
+ throw $ this ->httpError (400 , 'Missing required variable: ' . $ v );
396
398
}
397
399
398
400
$ output [] = $ this ->getVar ($ k );
399
401
} elseif (!$ this ->hasVar ($ v )) {
400
- throw $ this ->httpError (400 , 'Missing required variable: ' . $ v );
402
+ throw $ this ->httpError (400 , 'Missing required variable: ' . $ v );
401
403
} else {
402
404
$ output [] = $ this ->getVar ($ v );
403
405
}
0 commit comments