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 the timezone param

Kiran K5a0c66647210
diff --git a/apps/web/lib/analytics/get-analytics.ts b/apps/web/lib/analytics/get-analytics.ts
index 0381046cf2..0cb8e6651a 100644
--- a/apps/web/lib/analytics/get-analytics.ts
+++ b/apps/web/lib/analytics/get-analytics.ts
@@ -41,7 +41,7 @@ export const getAnalytics = async (
interval,
start,
end,
- timezone,
+ timezone = "UTC",
isDemo,
endpoint,
} = params;
@@ -108,7 +108,7 @@ export const getAnalytics = async (
const response = await pipe({
...params,
- eventType: eventType,
+ eventType,
workspaceId,
start: start.toISOString().replace("T", " ").replace("Z", ""),
end: end.toISOString().replace("T", " ").replace("Z", ""),
diff --git a/apps/web/lib/zod/schemas/analytics.ts b/apps/web/lib/zod/schemas/analytics.ts
index 5eda368726..7fa7684e19 100644
--- a/apps/web/lib/zod/schemas/analytics.ts
+++ b/apps/web/lib/zod/schemas/analytics.ts
@@ -81,10 +81,10 @@ export const analyticsQuerySchema = z.object({
timezone: z
.string()
.optional()
- .default("UTC")
.describe(
"The IANA time zone code for aligning timeseries granularity (e.g. America/New_York). Defaults to UTC.",
- ),
+ )
+ .openapi({ example: "America/New_York", default: "UTC" }),
country: z
.enum(COUNTRY_CODES)
.optional()