Spaces:
Runtime error
Runtime error
Commit ·
52e6d31
1
Parent(s): 3871436
add login validator schema
Browse files
src/validators/login.validator.ts
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import { checkSchema } from 'express-validator';
|
| 2 |
+
|
| 3 |
+
export const validateLogin = checkSchema({
|
| 4 |
+
email: {
|
| 5 |
+
notEmpty: {
|
| 6 |
+
errorMessage: 'Email is required',
|
| 7 |
+
},
|
| 8 |
+
isEmail: {
|
| 9 |
+
errorMessage: 'Invalid email address',
|
| 10 |
+
},
|
| 11 |
+
},
|
| 12 |
+
password: {
|
| 13 |
+
notEmpty: {
|
| 14 |
+
errorMessage: 'Password is required',
|
| 15 |
+
},
|
| 16 |
+
},
|
| 17 |
+
});
|