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.

set min max keyLength, fix domain primary test

Steven Tey3370c2b3cef2
diff --git a/apps/web/lib/zod/schemas/links.ts b/apps/web/lib/zod/schemas/links.ts
index 82cc7620ee..41bb27ab6a 100644
--- a/apps/web/lib/zod/schemas/links.ts
+++ b/apps/web/lib/zod/schemas/links.ts
@@ -248,6 +248,8 @@ export const createLinkBodySchema = z.object({
),
keyLength: z
.number()
+ .min(3)
+ .max(190)
.optional()
.describe(
"The length of the short link slug. Defaults to 7 if not provided. When used with `prefix`, the total length of the key will be `prefix.length + keyLength`.",
diff --git a/apps/web/tests/domains/index.test.ts b/apps/web/tests/domains/index.test.ts
index b3ff6f8639..a5178359f7 100644
--- a/apps/web/tests/domains/index.test.ts
+++ b/apps/web/tests/domains/index.test.ts
@@ -79,6 +79,14 @@ describe.sequential("/domains/**", async () => {
...expectedDomain,
primary: true,
});
+
+ onTestFinished(async () => {
+ // reset the primary domain
+ await http.post<Domain>({
+ path: "/domains/getacme.link/primary",
+ query: { workspaceId: workspace.id },
+ });
+ });
});
test("PATCH /domains/{slug}", { retry: 3 }, async () => {