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 Tey1e331ba2d7a0
diff --git a/apps/web/app/api/analytics/share/route.ts b/apps/web/app/api/analytics/share/route.ts
index 79108d2f6c..3516b3707b 100644
--- a/apps/web/app/api/analytics/share/route.ts
+++ b/apps/web/app/api/analytics/share/route.ts
@@ -3,6 +3,7 @@ import { createId } from "@/lib/api/utils";
import { withWorkspace } from "@/lib/auth";
import { prisma } from "@/lib/prisma";
import { domainKeySchema } from "@/lib/zod/schemas/links";
+import { waitUntil } from "@vercel/functions";
import { NextResponse } from "next/server";
// GET /api/analytics/share – get a shared dashboard for a link
@@ -42,6 +43,13 @@ export const POST = withWorkspace(
},
});
+ waitUntil(
+ prisma.link.update({
+ where: { id: link.id },
+ data: { publicStats: true },
+ }),
+ );
+
return NextResponse.json(response);
},
{