From 645b9ca9d4b79a9afe398000f0c9f6057de89c96 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20S=C3=B6derberg?= Date: Sat, 13 Apr 2024 19:11:14 +0200 Subject: [PATCH] api: add limit as query parameter --- apps/api/src/controllers/export.controller.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/apps/api/src/controllers/export.controller.ts b/apps/api/src/controllers/export.controller.ts index 0477adbc..d5b4ffc0 100644 --- a/apps/api/src/controllers/export.controller.ts +++ b/apps/api/src/controllers/export.controller.ts @@ -56,6 +56,7 @@ export async function events( return; } + const take = Math.max(Math.min(query.limit, 50), 1); const cursor = (parseInt(query.page || '1', 10) || 1) - 1; const options: GetEventListOptions = { projectId, @@ -65,7 +66,7 @@ export async function events( startDate: query.start ? new Date(query.start) : undefined, endDate: query.end ? new Date(query.end) : undefined, cursor, - take: 50, + take, meta: false, profile: true, };