Skip to content

Commit

Permalink
support disabling pagination (#150)
Browse files Browse the repository at this point in the history
enable limit/offset only if perPage is greater then -1
  • Loading branch information
alioguzhan authored May 29, 2023
1 parent b8f338d commit 8e8dc8d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/buildVariables/buildGetListVariables.ts
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ export const buildGetListVariables: BuildGetListVariables =
...(orFilters.length && { _or: orFilters }),
};

if (params.pagination) {
if (params.pagination && params.pagination.perPage > -1) {
result['limit'] = parseInt(params.pagination.perPage, 10);
result['offset'] =
(params.pagination.page - 1) * params.pagination.perPage;
Expand Down

0 comments on commit 8e8dc8d

Please sign in to comment.