@@ -26,45 +26,22 @@ export const changePasswordSchema = passwordSchema
2626
2727export const userSchema = passwordSchema
2828 . extend ( {
29- fullname : z
30- . string ( {
31- required_error : 'fullname is required' ,
32- invalid_type_error : 'fullname must be a string' ,
33- } )
34- . min ( 2 , "fullname can't be empty" ) ,
35- email : z
36- . string ( {
37- required_error : 'email is required' ,
38- invalid_type_error : 'email must be a string' ,
39- } )
40- . email ( { message : 'invalid email address' } )
41- . min ( 2 , "email can't be empty" ) ,
29+ fullname : z . string ( 'fullname is required' ) . min ( 2 , "fullname can't be empty" ) ,
30+ email : z . email ( { message : 'invalid email address' } ) . min ( 2 , "email can't be empty" ) ,
4231 phone : z . string ( ) . nullable ( ) ,
4332 token_verify : z . string ( ) . nullable ( ) ,
44- upload_id : z . string ( ) . uuid ( { message : 'upload_id invalid uuid format' } ) . nullable ( ) ,
45- is_active : z . boolean ( {
46- required_error : 'is_active is required' ,
47- invalid_type_error : 'is_active must be a boolean' ,
48- } ) ,
49- is_blocked : z . boolean ( {
50- required_error : 'is_blocked is required' ,
51- invalid_type_error : 'is_blocked must be a boolean' ,
52- } ) ,
53- role_id : z
54- . string ( {
55- required_error : 'role id is required' ,
56- invalid_type_error : 'role id must be a string' ,
57- } )
58- . uuid ( { message : 'role id invalid uuid format' } )
59- . min ( 2 , `role id can't be empty` ) ,
33+ upload_id : z . uuid ( 'upload_id invalid uuid format' ) . nullable ( ) ,
34+ is_active : z . boolean ( 'is_active is required' ) ,
35+ is_blocked : z . boolean ( 'is_blocked is required' ) ,
36+ role_id : z . uuid ( 'role id invalid uuid format' ) . min ( 2 , `role id can't be empty` ) ,
6037 } )
6138 . refine ( ( data ) => data . new_password === data . confirm_new_password , {
6239 message : "passwords don't match" ,
6340 path : [ 'confirm_new_password' ] , // path of error
6441 } )
6542
6643export const loginSchema = z . object ( {
67- email : z . string ( ) . email ( { message : 'invalid email address' } ) . min ( 2 , "email can't be empty" ) ,
44+ email : z . email ( 'invalid email address' ) . min ( 2 , "email can't be empty" ) ,
6845 password : z . string ( ) . min ( 2 , "password can't be empty" ) ,
6946 latitude : z . string ( ) . nullable ( ) ,
7047 longitude : z . string ( ) . nullable ( ) ,
0 commit comments