refactor: remove zod.trim() validators

This commit is contained in:
Fu Diwei
2025-06-15 21:40:21 +08:00
parent 0434f95a1e
commit e7ce12772a
119 changed files with 174 additions and 361 deletions

View File

@@ -25,11 +25,9 @@ const DeployNodeConfigFormBunnyCDNConfig = ({ form: formInst, formName, disabled
const { t } = useTranslation();
const formSchema = z.object({
pullZoneId: z
.union([z.string(), z.number().int()])
.refine((v) => {
return /^\d+$/.test(v + "") && +v! > 0;
}, t("workflow_node.deploy.form.bunny_cdn_pull_zone_id.placeholder")),
pullZoneId: z.union([z.string(), z.number().int()]).refine((v) => {
return /^\d+$/.test(v + "") && +v! > 0;
}, t("workflow_node.deploy.form.bunny_cdn_pull_zone_id.placeholder")),
hostname: z
.string({ message: t("workflow_node.deploy.form.bunny_cdn_hostname.placeholder") })
.nonempty(t("workflow_node.deploy.form.bunny_cdn_hostname.placeholder"))