feat: change wording validation

This commit is contained in:
egagofur
2025-04-03 19:40:04 +07:00
parent 6b959a2f22
commit 6bad504d44
2 changed files with 13 additions and 5 deletions
+12 -4
View File
@@ -2,8 +2,16 @@ import { z } from 'zod';
export const authLoginSchema = z.object({ export const authLoginSchema = z.object({
email: z email: z
.string() .string({
.min(1, 'Email cannot be empty') required_error: 'Email tidak boleh kosong',
.email('Email must be valid'), invalid_type_error: 'Email harus berupa string',
password: z.string().min(1, 'Password cannot be empty'), })
.min(1, 'Email tidak boleh kosong')
.email('Email harus valid'),
password: z
.string({
required_error: 'Password tidak boleh kosong',
invalid_type_error: 'Password harus berupa string',
})
.min(1, 'Password tidak boleh kosong'),
}); });
@@ -75,7 +75,7 @@ export const InputField: FC<TInputFieldProps> = ({
{...rest} {...rest}
/> />
{error ? ( {error ? (
<p className="text-danger-500 text-xs mt-1">{error}</p> <p className="text-danger-500 text-xl mt-1">{error}</p>
) : ( ) : (
helperText && ( helperText && (
<p className={cn('text-cs mt-1', sizeClasses[size].helperText)}> <p className={cn('text-cs mt-1', sizeClasses[size].helperText)}>