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.

missed a spot

Steven Tey25ed37b3ff2c
diff --git a/apps/web/app/api/analytics/[endpoint]/route.ts b/apps/web/app/api/analytics/[endpoint]/route.ts
index 46dd0fc3c0..2a875287d6 100644
--- a/apps/web/app/api/analytics/[endpoint]/route.ts
+++ b/apps/web/app/api/analytics/[endpoint]/route.ts
@@ -10,14 +10,14 @@ import { NextResponse } from "next/server";
// GET /api/analytics/[endpoint] – get analytics for a specific endpoint
export const GET = withAuth(
- async ({ params, searchParams, project, link }) => {
+ async ({ params, searchParams, workspace, link }) => {
const { endpoint } = analyticsEndpointSchema.parse(params);
const parsedParams = getAnalyticsQuerySchema.parse(searchParams);
const { domain, key, interval } = parsedParams;
- // return 403 if project is on the free plan and interval is 90d or all
+ // return 403 if workspace is on the free plan and interval is 90d or all
if (
- project?.plan === "free" &&
+ workspace?.plan === "free" &&
(interval === "all" || interval === "90d")
) {
throw new DubApiError({
@@ -33,7 +33,7 @@ export const GET = withAuth(
: null;
const response = await getAnalytics({
- projectId: project.id,
+ projectId: workspace.id,
...(linkId && { linkId }),
endpoint,
...parsedParams,