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.

use region code

Kiran Kc44c2010ef56
diff --git a/apps/web/lib/zod/schemas/analytics.ts b/apps/web/lib/zod/schemas/analytics.ts
index 6a8dc7e8ff..fdb4e8313b 100644
--- a/apps/web/lib/zod/schemas/analytics.ts
+++ b/apps/web/lib/zod/schemas/analytics.ts
@@ -13,6 +13,7 @@ import {
COUNTRY_CODES,
DUB_FOUNDING_DATE,
PAGINATION_LIMIT,
+ REGION_CODES,
capitalize,
formatDate,
} from "@dub/utils";
@@ -113,10 +114,10 @@ export const analyticsQuerySchema = z.object({
.describe("The continent to retrieve analytics for.")
.openapi({ ref: "continentCode" }),
region: z
- .string()
+ .enum(REGION_CODES)
.optional()
.describe("The region to retrieve analytics for.")
- .openapi({ example: "California" }),
+ .openapi({ ref: "regionCode" }),
country: z
.enum(COUNTRY_CODES)
.optional()