modarb-be / src /helpers /pagination.ts
moahmedwafy's picture
feat: crud service
484fdbc
raw
history blame
268 Bytes
import { Request } from "express";
export const parsePaginationQuery = (query: Request["query"]) => {
const limit = query.take && parseInt(query.limit as string);
const skip = query.skip && parseInt(query.skip as string);
return {
limit,
skip,
};
};