Files
quicklanch-server/dist/app/middlewares/request_validator.js
T

13 lines
278 B
JavaScript
Raw Normal View History

const RequestValidator = (schema) => {
return async (req, res, next) => {
try {
req.body = await schema.parseAsync(req.body);
next();
}
catch (err) {
next(err);
}
};
};
export default RequestValidator;