paginationSchema: don't set a default for `until`

This commit is contained in:
Alex Gleason 2024-03-21 19:22:25 -05:00
parent ccffe3abea
commit 8bed0c17be
No known key found for this signature in database
GPG Key ID: 7211D1F99744FBB7
1 changed files with 1 additions and 1 deletions

View File

@ -115,7 +115,7 @@ async function parseBody(req: Request): Promise<unknown> {
/** Schema to parse pagination query params. */ /** Schema to parse pagination query params. */
const paginationSchema = z.object({ const paginationSchema = z.object({
since: z.coerce.number().optional().catch(undefined), 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)), limit: z.coerce.number().catch(20).transform((value) => Math.min(Math.max(value, 0), 40)),
}); });