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 Tey244a95d7f6b8
diff --git a/apps/web/app/api/admin/refresh-domain/route.ts b/apps/web/app/api/admin/refresh-domain/route.ts
index f22d1c186e..4735f2b5e0 100644
--- a/apps/web/app/api/admin/refresh-domain/route.ts
+++ b/apps/web/app/api/admin/refresh-domain/route.ts
@@ -1,4 +1,4 @@
-import { addDomainToVercel, removeDomainFromVercel } from "@/lib/api/domains";
+import { addDomainToVercel } from "@/lib/api/domains";
import { withAdmin } from "@/lib/auth";
import { NextResponse } from "next/server";
@@ -6,7 +6,15 @@ import { NextResponse } from "next/server";
export const POST = withAdmin(async ({ req }) => {
const { domain } = await req.json();
- const remove = await removeDomainFromVercel(domain);
+ const remove = await fetch(
+ `https://api.vercel.com/v9/projects/${process.env.PROJECT_ID_VERCEL}/domains/${domain}?teamId=${process.env.TEAM_ID_VERCEL}`,
+ {
+ headers: {
+ Authorization: `Bearer ${process.env.AUTH_BEARER_TOKEN}`,
+ },
+ method: "DELETE",
+ },
+ ).then((res) => res.json());
const add = await addDomainToVercel(domain);
console.log({ remove, add });