Make pagination optional (#15163)

This commit is contained in:
Syed Ali Shahbaz
2024-05-22 17:51:36 +00:00
committed by GitHub
parent a7b5fd593e
commit 04bf23ed69
+4 -2
View File
@@ -180,8 +180,10 @@ export async function handler(req: NextApiRequest) {
const { dateFrom, dateTo } = schemaBookingGetParams.parse(req.query);
const args: Prisma.BookingFindManyArgs = {};
args.take = take;
args.skip = skip;
if (req.query.take && req.query.page) {
args.take = take;
args.skip = skip;
}
args.include = {
attendees: true,
user: true,