From 8bed0c17be29229f356f9ba7392ed20dca3b323e Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Thu, 21 Mar 2024 19:22:25 -0500 Subject: [PATCH] paginationSchema: don't set a default for `until` --- src/utils/api.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/utils/api.ts b/src/utils/api.ts index 563cdb7..476f854 100644 --- a/src/utils/api.ts +++ b/src/utils/api.ts @@ -115,7 +115,7 @@ async function parseBody(req: Request): Promise { /** Schema to parse pagination query params. */ const paginationSchema = z.object({ since: z.coerce.number().optional().catch(undefined), - until: z.lazy(() => z.coerce.number().catch(nostrNow())), + until: z.coerce.number().optional().catch(undefined), limit: z.coerce.number().catch(20).transform((value) => Math.min(Math.max(value, 0), 40)), });