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 demo analytics

Steven Teybf70debc0b97
diff --git a/apps/web/app/api/analytics/demo/route.ts b/apps/web/app/api/analytics/demo/route.ts
index 9da7a746e1..9e3999b354 100644
--- a/apps/web/app/api/analytics/demo/route.ts
+++ b/apps/web/app/api/analytics/demo/route.ts
@@ -1,6 +1,7 @@
import { getAnalytics } from "@/lib/analytics/get-analytics";
import { withSession } from "@/lib/auth";
import { analyticsQuerySchema } from "@/lib/zod/schemas/analytics";
+import { DUB_WORKSPACE_ID } from "@dub/utils";
import { NextResponse } from "next/server";
// GET /api/analytics/demo
@@ -10,6 +11,7 @@ export const GET = withSession(async ({ searchParams }) => {
const response = await getAnalytics({
...parsedParams,
isDemo: true,
+ workspaceId: DUB_WORKSPACE_ID,
});
return NextResponse.json(response);
diff --git a/apps/web/lib/analytics/constants.ts b/apps/web/lib/analytics/constants.ts
index 4a6968591b..091176e7d0 100644
--- a/apps/web/lib/analytics/constants.ts
+++ b/apps/web/lib/analytics/constants.ts
@@ -1,5 +1,4 @@
export const intervals = [
- "1h",
"24h",
"7d",
"30d",
@@ -48,10 +47,6 @@ export const INTERVAL_DATA: Record<
granularity: "minute" | "hour" | "day" | "month";
}
> = {
- "1h": {
- startDate: new Date(Date.now() - 3600000),
- granularity: "minute",
- },
"24h": {
startDate: new Date(Date.now() - 86400000),
granularity: "hour",