From e78021643b3736351df25a2fcb0e15223e52ae02 Mon Sep 17 00:00:00 2001 From: sianida26 Date: Wed, 28 Feb 2024 21:31:04 +0700 Subject: [PATCH] Fix schema --- src/app/(auth)/register/page.tsx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/app/(auth)/register/page.tsx b/src/app/(auth)/register/page.tsx index 53e498f..a187ed2 100644 --- a/src/app/(auth)/register/page.tsx +++ b/src/app/(auth)/register/page.tsx @@ -25,19 +25,19 @@ export default function RegisterPage() { const form = useForm({ initialValues: { email: "", - plainPassword: "", - plainPasswordConfirmation: "", + password: "", + passwordConfirmation: "", name: "", }, validate: { email: (value: string) => /^\S+@\S+$/.test(value) ? null : "Invalid email", - plainPassword: (value: string) => + password: (value: string) => value.length >= 6 ? null : "Password should be at least 6 characters", - plainPasswordConfirmation: (value: string, values: CreateUserSchema) => - value === values.plainPassword ? null : "Passwords should match", + passwordConfirmation: (value: string, values: CreateUserSchema) => + value === values.password ? null : "Passwords should match", name: (value: string) => value.length > 0 ? null : "Name is required", },