From c80a9e5d9a47d29f5dbb2a584b530b48e09c600d Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Sat, 8 Jul 2023 15:21:28 -0500 Subject: [PATCH] paginationSchema: fix problem with nostrNow() being called only at startup --- src/utils.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/utils.ts b/src/utils.ts index 89716af5..c78e1cf7 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -80,7 +80,7 @@ async function parseBody(req: Request): Promise { const paginationSchema = z.object({ since: z.coerce.number().optional().catch(undefined), - until: z.coerce.number().catch(nostrNow()), + until: z.lazy(() => z.coerce.number().catch(nostrNow())), limit: z.coerce.number().min(0).max(40).catch(20), });