Skip to content

armgit / dify

Public Imported from GitHub
0

Build Agentic workflows, RAG pipelines, with rich AI model and tool support on one collaborative workspace. Deploy on cloud, VPC, or self-hosted, so teams move from prototype to production without rebuilding the stack.

refactor(web): use Zod validate for boolean form checks (#42398)

yyha14ebae6a4a4
diff --git a/web/app/forgot-password/ForgotPasswordForm.tsx b/web/app/forgot-password/ForgotPasswordForm.tsx
index b47ce212c47..21b128af43e 100644
--- a/web/app/forgot-password/ForgotPasswordForm.tsx
+++ b/web/app/forgot-password/ForgotPasswordForm.tsx
@@ -93,7 +93,7 @@ const ForgotPasswordForm = () => {
<Field
name="email"
validate={(value) =>
- emailSchema.safeParse(value).success
+ emailSchema.validate(value)
? null
: t(($) => $['error.emailInValid'], { ns: 'login' })
}
diff --git a/web/app/install/installForm.tsx b/web/app/install/installForm.tsx
index 7066080c042..9c87efa4374 100644
--- a/web/app/install/installForm.tsx
+++ b/web/app/install/installForm.tsx
@@ -110,7 +110,7 @@ const InstallForm = () => {
<Field
name="email"
validate={(value) =>
- accountFormSchema.shape.email.safeParse(value).success
+ accountFormSchema.shape.email.validate(value)
? null
: t(($) => $['error.emailInValid'], { ns: 'login' })
}
@@ -130,7 +130,7 @@ const InstallForm = () => {
<Field
name="name"
validate={(value) =>
- accountFormSchema.shape.name.safeParse(value).success
+ accountFormSchema.shape.name.validate(value)
? null
: t(($) => $['error.nameEmpty'], { ns: 'login' })
}
@@ -149,7 +149,7 @@ const InstallForm = () => {
<Field
name="password"
validate={(value) =>
- accountFormSchema.shape.password.safeParse(value).success
+ accountFormSchema.shape.password.validate(value)
? null
: t(($) => $['error.passwordInvalid'], { ns: 'login' })
}