The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.
TypeScript clickhousemysqlnextjsopen-sourceplanetscaleprismatailwindcsstinybirdtypescriptupstashvercel
Update route.ts
Steven Teydb01e1d42541
diff --git a/apps/web/app/api/domains/register/route.ts b/apps/web/app/api/domains/register/route.tsindex 0b805b7988..9a30eaabb6 100644--- a/apps/web/app/api/domains/register/route.ts+++ b/apps/web/app/api/domains/register/route.ts@@ -24,17 +24,18 @@ export const POST = withWorkspace(const { domain } = schema.parse(searchParams);- const existingDotLinkDomain = await prisma.domain.findFirst({- where: {- projectId: workspace.id,- slug: {- endsWith: ".link",+ const existingRegisteredDotLinkDomain =+ await prisma.registeredDomain.findFirst({+ where: {+ projectId: workspace.id,+ slug: {+ endsWith: ".link",+ },},- },- });+ });- if (existingDotLinkDomain)- throw new Error("Workspace is limited to one .link domain.");+ if (existingRegisteredDotLinkDomain)+ throw new Error("Workspace is limited to one free .link domain.");const response = await registerDomain({ domain });const slug = response.RegisterResponse.DomainName;