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.

Skip Vercel removal for staging domains

Rafif13bf49e9359
diff --git a/apps/web/lib/api/domains/remove-domain-vercel.ts b/apps/web/lib/api/domains/remove-domain-vercel.ts
index 4a7878e432..4279f026fb 100644
--- a/apps/web/lib/api/domains/remove-domain-vercel.ts
+++ b/apps/web/lib/api/domains/remove-domain-vercel.ts
@@ -1,7 +1,14 @@
import { prisma } from "@/lib/prisma";
+import { STAGING_DUB_DOMAIN_SUFFIX } from "@/lib/sandbox/constants";
import { getApexDomain } from "@dub/utils";
export const removeDomainFromVercel = async (domain: string) => {
+ // Staging hosts are served by the `*.staging.dub.link` wildcard and were
+ // never added to Vercel one by one, so there is nothing to remove.
+ if (domain.toLowerCase().endsWith(STAGING_DUB_DOMAIN_SUFFIX)) {
+ return null;
+ }
+
const apexDomain = getApexDomain(`https://${domain}`);
const domains = await prisma.domain.findMany({
where: {