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

Steven Tey525940995447
diff --git a/apps/web/app/api/analytics/share/route.ts b/apps/web/app/api/analytics/share/route.ts
index 11f1261b20..cd5108dfdd 100644
--- a/apps/web/app/api/analytics/share/route.ts
+++ b/apps/web/app/api/analytics/share/route.ts
@@ -58,17 +58,9 @@ export const DELETE = withWorkspace(async ({ searchParams, workspace }) => {
key,
});
- await prisma.link.update({
- where: {
- id: link.id,
- },
- data: {
- publicStats: false,
- sharedDashboard: {
- delete: {},
- },
- },
+ const response = await prisma.sharedDashboard.delete({
+ where: { linkId: link.id },
});
- return NextResponse.json({ success: true });
+ return NextResponse.json({ dashboardId: response.id });
});