fix: nullable type

This commit is contained in:
Lorenzo Migliorero
2024-07-25 08:59:10 +02:00
parent fa5b75e6fb
commit 115c8641e7
3 changed files with 7 additions and 6 deletions

View File

@@ -37,11 +37,12 @@ const hostnameRegex = /^[a-zA-Z0-9][a-zA-Z0-9\.-]*\.[a-zA-Z]{2,}$/;
const domain = z.object({
host: z.string().regex(hostnameRegex, { message: "Invalid hostname" }),
path: z.string().min(1),
path: z.string().min(1).nullable(),
port: z
.number()
.min(1, { message: "Port must be at least 1" })
.max(65535, { message: "Port must be 65535 or below" }),
.max(65535, { message: "Port must be 65535 or below" })
.nullable(),
https: z.boolean(),
certificateType: z.enum(["letsencrypt", "none"]),
});