Skip to content

SudoSOS Back-end API / helpers / parseRequestPagination

Function: parseRequestPagination() ​

ts
function parseRequestPagination(req): object;

Extract possible pagination parameters from the request and put them in the take and skip variables. If one of them (or all of them) is not defined, default values are set.

Parameters ​

ParameterTypeDescription
reqRequest-

Returns ​

object

skip ​

ts
skip: number;

take ​

ts
take: number;

Throws ​

pagination query parameters are not positive integers or undefined