The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.
TypeScript clickhousemysqlnextjsopen-sourceplanetscaleprismatailwindcsstinybirdtypescriptupstashvercel
update noindex setup
Steven Tey5478379347c2
diff --git a/apps/web/app/api/domains/[domain]/route.ts b/apps/web/app/api/domains/[domain]/route.tsindex afd3916d49..32ce3b7654 100644--- a/apps/web/app/api/domains/[domain]/route.ts+++ b/apps/web/app/api/domains/[domain]/route.ts@@ -93,7 +93,7 @@ export const PATCH = withWorkspace(...(workspace.plan !== "free" && {target,expiredUrl,- noindex,+ noindex: noindex === undefined ? true : noindex,}),},});@@ -106,7 +106,7 @@ export const PATCH = withWorkspace(domainCreatedAt: response.createdAt,...(workspace.plan !== "free" && {url: target || undefined,- noindex,+ noindex: noindex === undefined ? true : noindex,}),rewrite: type === "rewrite",...(newDomain !== domain && {diff --git a/apps/web/app/api/domains/route.ts b/apps/web/app/api/domains/route.tsindex 888377c3b2..76cd78402d 100644--- a/apps/web/app/api/domains/route.ts+++ b/apps/web/app/api/domains/route.ts@@ -75,7 +75,7 @@ export const POST = withWorkspace(async ({ req, workspace }) => {...(workspace.plan !== "free" && {target,expiredUrl,- noindex,+ noindex: noindex === undefined ? true : noindex,}),},});@@ -88,7 +88,7 @@ export const POST = withWorkspace(async ({ req, workspace }) => {projectId: workspace.id,...(workspace.plan !== "free" && {url: target || undefined,- noindex,+ noindex: noindex === undefined ? true : noindex,}),rewrite: type === "rewrite",}),diff --git a/apps/web/lib/zod/schemas/domains.ts b/apps/web/lib/zod/schemas/domains.tsindex 4c3e6d6346..5a240ce9fc 100644--- a/apps/web/lib/zod/schemas/domains.ts+++ b/apps/web/lib/zod/schemas/domains.ts@@ -86,11 +86,9 @@ export const addDomainBodySchema = z.object({noindex: z.boolean().optional()- .default(false).describe("Prevent search engines from indexing the domain. Defaults to `false`.",- )- .openapi({ example: false }),+ ),placeholder: parseUrlSchema.nullish().default("https://dub.co/help/article/what-is-dub")diff --git a/apps/web/ui/modals/add-edit-domain-modal/index.tsx b/apps/web/ui/modals/add-edit-domain-modal/index.tsxindex c9cc0c8b9a..71a9fb9da2 100644--- a/apps/web/ui/modals/add-edit-domain-modal/index.tsx+++ b/apps/web/ui/modals/add-edit-domain-modal/index.tsx@@ -196,8 +196,18 @@ function AddEditDomainModal({<div><label htmlFor="target" className="flex items-center space-x-2">- <h2 className="text-sm font-medium text-gray-900">Landing Page</h2>- <InfoTooltip content="The page your users will get redirected to when they visit your domain." />+ <h2 className="text-sm font-medium text-gray-900">+ Destination URL+ </h2>+ <InfoTooltip+ content={+ <SimpleTooltipContent+ title="The page your users will get redirected to when they visit your domain."+ cta="Learn more."+ href="https://dub.co/help/article/how-to-redirect-root-domain"+ />+ }+ /></label>{plan === "free" ? (<Tooltip@@ -362,7 +372,15 @@ function AddEditDomainModal({<h2 className="text-sm font-medium text-gray-900">Disable Search Engine Indexing</h2>- <InfoTooltip content="Prevent search engines from indexing your root domain." />+ <InfoTooltip+ content={+ <SimpleTooltipContent+ title="Prevent search engines from indexing your root domain."+ cta="Learn more."+ href="https://dub.co/help/article/how-noindex-works"+ />+ }+ /></div><Switchchecked={data.noindex}