1 parent
7aebdb8c96
commit
6cec8620cb
2 files changed
+6
-3
No files matched your search
@@ -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,
|
||||
|
||||
Reference in new issue
Block a user