mirror of
https://github.com/fosrl/pangolin.git
synced 2026-03-02 00:36:38 +00:00
used zod codemod
This commit is contained in:
@@ -19,16 +19,13 @@ import { isIpInCidr } from "@server/lib/ip";
|
||||
import { verifyExitNodeOrgAccess } from "#dynamic/lib/exitNodes";
|
||||
import { build } from "@server/build";
|
||||
|
||||
const createSiteParamsSchema = z
|
||||
.object({
|
||||
const createSiteParamsSchema = z.strictObject({
|
||||
orgId: z.string()
|
||||
})
|
||||
.strict();
|
||||
});
|
||||
|
||||
const createSiteSchema = z
|
||||
.object({
|
||||
const createSiteSchema = z.strictObject({
|
||||
name: z.string().min(1).max(255),
|
||||
exitNodeId: z.number().int().positive().optional(),
|
||||
exitNodeId: z.int().positive().optional(),
|
||||
// subdomain: z
|
||||
// .string()
|
||||
// .min(1)
|
||||
@@ -41,8 +38,7 @@ const createSiteSchema = z
|
||||
secret: z.string().optional(),
|
||||
address: z.string().optional(),
|
||||
type: z.enum(["newt", "wireguard", "local"])
|
||||
})
|
||||
.strict();
|
||||
});
|
||||
// .refine((data) => {
|
||||
// if (data.type === "local") {
|
||||
// return !config.getRawConfig().flags?.disable_local_sites;
|
||||
|
||||
Reference in New Issue
Block a user