Pagination issue fixed, total added (#227)

Fixes #217.
This commit is contained in:
Leo Giovanetti authored and GitHub committed 2023-01-18 12:49:31 -07:00
1 parent 7aebdb8c96
commit 6cec8620cb
2 files changed
+6 -3

No files matched your search

+1 -1
View File
@@ -16,7 +16,7 @@ const withPage = z.object({
export const withPagination: NextMiddleware = async (req, _, next) => {
const { page, take } = withPage.parse(req.query);
const skip = page * take || 0;
const skip = (page - 1) * take;
req.pagination = {
take,
skip,