mirror of
https://github.com/strapi/strapi.git
synced 2025-11-16 18:19:34 +00:00
Use a type check instead of a default value for maxLimit
This commit is contained in:
parent
bac1fb9210
commit
9ffe97a2ab
@ -105,8 +105,10 @@ const getPaginationInfo = (params: { pagination?: PaginationParams }): Paginatio
|
|||||||
|
|
||||||
return {
|
return {
|
||||||
page: Math.max(1, toNumber(pagination.page || 1)),
|
page: Math.max(1, toNumber(pagination.page || 1)),
|
||||||
pageSize: shouldApplyMaxLimit(pageSize, maxLimit, { isPagedPagination: true })
|
pageSize:
|
||||||
? maxLimit ?? 1
|
typeof maxLimit === 'number' &&
|
||||||
|
shouldApplyMaxLimit(pageSize, maxLimit, { isPagedPagination: true })
|
||||||
|
? maxLimit
|
||||||
: Math.max(1, pageSize),
|
: Math.max(1, pageSize),
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user