Skip to content

Commit

Permalink
parse int for page size
Browse files Browse the repository at this point in the history
  • Loading branch information
birm committed Apr 24, 2024
1 parent af18868 commit 0e959c7
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions service/database/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ class Mongo {
const collection = getConnection(database).collection(collectionName);
let { _page = 0, _pageSize = 1000, ...filterQuery } = query;
const _skip = _page * _pageSize;
_pageSize = parseInt(_pageSize, 10);
const data = await collection.find(filterQuery).skip(_skip).limit(_pageSize).toArray();

/** allow caller method to toggle response transformation */
Expand Down

0 comments on commit 0e959c7

Please sign in to comment.