Skip to content

armgit / dub

Public Imported from GitHub
0

The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.

Fix pagination schema to enforce non-negative integers for 'page' parameter

aliamerj94eb5211eebc
diff --git a/apps/web/lib/zod/schemas/links.ts b/apps/web/lib/zod/schemas/links.ts
index 0235612897..1e80e0ecc7 100644
--- a/apps/web/lib/zod/schemas/links.ts
+++ b/apps/web/lib/zod/schemas/links.ts
@@ -82,6 +82,8 @@ export const getLinksQuerySchema = LinksQuerySchema.merge(
),
page: z.coerce
.number()
+ .int()
+ .nonnegative()
.optional()
.describe(
"The page number for pagination (each page contains 100 links).",