Created
June 29, 2022 02:24
-
-
Save IvsonEmidio/9abdd375b21f5b80980872a9a70781e1 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { body, ValidationChain } from "express-validator"; | |
export function validatePost(): ValidationChain[] { | |
return [ | |
body("name", "check the field 'name' and try again.") | |
.isString() | |
.isLength({ min: 3, max: 35 }), | |
body("email", "check the field 'email' and try again").isEmail(), | |
body( | |
"password", | |
"check the field 'password' and try again" | |
).isStrongPassword(), | |
]; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment