xsender / src /wp /middlewares /requestValidator.js
Softin Trading
Initail commit from Github.
89a1081
Raw History Blame Contribute Delete
332 Bytes
import { validationResult } from 'express-validator'
import response from './../../response.js'
const validate = (req, res, next) => {
const errors = validationResult(req)
if (!errors.isEmpty()) {
return response(res, 400, false, 'Please fill out all required input.')
}
next()
}
export default validate