mirror of
https://github.com/Dokploy/dokploy
synced 2025-06-26 18:27:59 +00:00
fix: nullable type
This commit is contained in:
@@ -63,8 +63,8 @@ const baseDomain: Domain = {
|
|||||||
domainId: "",
|
domainId: "",
|
||||||
host: "",
|
host: "",
|
||||||
https: false,
|
https: false,
|
||||||
path: "",
|
path: null,
|
||||||
port: 3000,
|
port: null,
|
||||||
uniqueConfigKey: 1,
|
uniqueConfigKey: 1,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -37,11 +37,12 @@ const hostnameRegex = /^[a-zA-Z0-9][a-zA-Z0-9\.-]*\.[a-zA-Z]{2,}$/;
|
|||||||
|
|
||||||
const domain = z.object({
|
const domain = z.object({
|
||||||
host: z.string().regex(hostnameRegex, { message: "Invalid hostname" }),
|
host: z.string().regex(hostnameRegex, { message: "Invalid hostname" }),
|
||||||
path: z.string().min(1),
|
path: z.string().min(1).nullable(),
|
||||||
port: z
|
port: z
|
||||||
.number()
|
.number()
|
||||||
.min(1, { message: "Port must be at least 1" })
|
.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(),
|
https: z.boolean(),
|
||||||
certificateType: z.enum(["letsencrypt", "none"]),
|
certificateType: z.enum(["letsencrypt", "none"]),
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -13,8 +13,8 @@ export const domains = pgTable("domain", {
|
|||||||
.$defaultFn(() => nanoid()),
|
.$defaultFn(() => nanoid()),
|
||||||
host: text("host").notNull(),
|
host: text("host").notNull(),
|
||||||
https: boolean("https").notNull().default(false),
|
https: boolean("https").notNull().default(false),
|
||||||
port: integer("port").default(80).notNull(),
|
port: integer("port").default(80),
|
||||||
path: text("path").default("/").notNull(),
|
path: text("path").default("/"),
|
||||||
uniqueConfigKey: serial("uniqueConfigKey"),
|
uniqueConfigKey: serial("uniqueConfigKey"),
|
||||||
createdAt: text("createdAt")
|
createdAt: text("createdAt")
|
||||||
.notNull()
|
.notNull()
|
||||||
|
|||||||
Reference in New Issue
Block a user