Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const Validator = require("validator");
- const isEmpty = require("./is-empty");
- module.exports = function validateRegisterInput(data) {
- const errors = {};
- if (!Validator.isLength(data.name, { min: 2, max: 30 })) {
- errors.name = "Ime mora biti od 2 do 30 karaktera"
- };
- return {
- errors,
- isValid: isEmpty(errors)
- };
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement