File tree Expand file tree Collapse file tree 1 file changed +29
-0
lines changed Expand file tree Collapse file tree 1 file changed +29
-0
lines changed Original file line number Diff line number Diff line change
1
+ import Joi from "joi" ;
2
+
3
+ const addUserValidation = Joi . object ( {
4
+ name : Joi . string ( ) . required ( ) . trim ( ) ,
5
+ email : Joi . string ( ) . required ( ) . trim ( ) ,
6
+ password : Joi . string ( ) . required ( ) ,
7
+ } ) ;
8
+
9
+ const updateUserValidation = Joi . object ( {
10
+ name : Joi . string ( ) . trim ( ) ,
11
+ password : Joi . string ( ) ,
12
+ id : Joi . string ( ) . hex ( ) . length ( 24 ) . required ( ) ,
13
+ } ) ;
14
+
15
+ const changeUserPasswordValidation = Joi . object ( {
16
+ password : Joi . string ( ) . required ( ) ,
17
+ id : Joi . string ( ) . hex ( ) . length ( 24 ) . required ( ) ,
18
+ } ) ;
19
+
20
+ const deleteUserValidation = Joi . object ( {
21
+ id : Joi . string ( ) . hex ( ) . length ( 24 ) . required ( ) ,
22
+ } ) ;
23
+
24
+ export {
25
+ addUserValidation ,
26
+ updateUserValidation ,
27
+ changeUserPasswordValidation ,
28
+ deleteUserValidation ,
29
+ } ;
You can’t perform that action at this time.
0 commit comments