paginationSchema: fix problem with nostrNow() being called only at startup

This commit is contained in:
Alex Gleason 2023-07-08 15:21:28 -05:00
parent cc751f03a7
commit c80a9e5d9a
No known key found for this signature in database
GPG Key ID: 7211D1F99744FBB7
1 changed files with 1 additions and 1 deletions

View File

@ -80,7 +80,7 @@ async function parseBody(req: Request): Promise<unknown> {
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),
});