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 when root domain

Kiran Ke3e0d622bd64
diff --git a/apps/web/app/api/links/[linkId]/route.ts b/apps/web/app/api/links/[linkId]/route.ts
index a02258bda2..3e0aa77b7b 100644
--- a/apps/web/app/api/links/[linkId]/route.ts
+++ b/apps/web/app/api/links/[linkId]/route.ts
@@ -69,6 +69,12 @@ export const PATCH = withWorkspace(
: link.expiresAt,
geo: link.geo as NewLinkProps["geo"],
...body,
+
+ // When root domain
+ ...(link.key === "_root" && {
+ domain: link.domain,
+ key: link.key,
+ }),
};
// if link and updatedLink are identical, return the link