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