File size: 485 Bytes
59c49c1
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
const { body } = require("express-validator");

exports.updateMeValidation = [
  body("name").optional().isString().withMessage("Invalid name"),
  body("email").optional().isEmail().withMessage("Invalid email"),
  body("phone")
    .optional()
    .isLength({ min: 11, max: 11 })
    .withMessage("Phone must be 11 digits"),
  body("city").optional().isString().withMessage("Invalid city"),
  body("currentPassword")
    .notEmpty()
    .withMessage("Current password is required")
];