From 3c824d571eafedcccbcce9b2a26d4fdb60f2a398 Mon Sep 17 00:00:00 2001 From: pheralb Date: Mon, 1 Apr 2024 15:00:19 +0100 Subject: [PATCH] Update custom slug schema --- src/server/schemas/index.ts | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/server/schemas/index.ts b/src/server/schemas/index.ts index aaad1a4..8693f6f 100644 --- a/src/server/schemas/index.ts +++ b/src/server/schemas/index.ts @@ -24,9 +24,8 @@ export const CreateLinkSchema = z.object({ }), slug: z .string() - .min(1, { - message: - "Short link is required. Enter a custom slug or click on 'Randomize' button.", + .min(4, { + message: "Short link is required and must be at least 4 characters long.", }) .regex(/^[a-zA-Z0-9_-]*$/, { message: @@ -55,7 +54,9 @@ export const EditLinkSchema = z.object({ }), slug: z .string() - .min(1, { message: "Short link is required." }) + .min(4, { + message: "Short link is required and must be at least 4 characters long.", + }) .regex(/^[a-zA-Z0-9_-]*$/, { message: "Custom short link must not contain any blank spaces.", })