feat: change wording validation
This commit is contained in:
@@ -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)}>
|
||||||
|
|||||||
Reference in New Issue
Block a user