middleware/validate/store/update/information/name
unknown
plain_text
a year ago
419 B
17
Indexable
const { body, validationResult } = require('express-validator')
const updateStoreNameValidator = [
// Validate name
body("name")
.isString()
.withMessage("name must be a string"),
(req, res, next) => {
const errors = validationResult(req)
if (!errors.isEmpty()) {
return res.status(400).json({ errors: errors.array() })
}
next()
}
]
module.exports = updateStoreNameValidatorEditor is loading...
Leave a Comment