Express validator isLength pass undefined value

Viewed 8

I am new to MERN Stack and I am following a course. I have encounter this problem that the value is undefined from the validator.

I am using "express-validator": "^6.14.2" from NPM.

router.post(
  "/signup",
  [
   check("name").not().isEmpty(),
   check("email").normalizeEmail().isEmail(),
   check("password").isLength({ min: 6 }),
 ],
 signup
);

Postman request

{
"name":"test 2",
"email":"test2@test.com",
"password:":"test123456",
"places":1
}

Changing the value of name from the postman is gives me the proper value that is an empty string, but the password is gives me an undefine value see picture below

enter image description here

I have also tried this check("password").not().isEmpty().isLength({ min: 6 }), but still it gives me the same problem value is undefined

0 Answers
Related