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.

Update route.ts

Tim Wilsonf9e5be7aeaf9
diff --git a/apps/web/app/api/analytics/dashboard/route.ts b/apps/web/app/api/analytics/dashboard/route.ts
index d990b79b5d..fd733b6d22 100644
--- a/apps/web/app/api/analytics/dashboard/route.ts
+++ b/apps/web/app/api/analytics/dashboard/route.ts
@@ -49,7 +49,17 @@ export const GET = async (req: Request) => {
createdAt: true,
},
},
- ...(domain && key ? { links: { select: { id: true } } } : {}),
+ ...(domain && key
+ ? {
+ links: {
+ select: { id: true },
+ where: {
+ domain,
+ key,
+ },
+ },
+ }
+ : {}),
},
});