Kaushik Narayan R 32735ad7ff boom!
overall: formatting check, jsdoc type hints, express res/return stuff

utils - changes in logger, dateformatter and removed unneeded ones

.env file changes

license check, readme update

package.json update - version, deps, URLs

server cleanup

sequelize config check
2024-08-14 21:08:58 +05:30

28 lines
687 B
JavaScript

const { body, header, param, query } = require("express-validator");
const typedefs = require("../typedefs");
/**
* Validator middleware function
*
* Use the necessary part of the request, such as params for URL parameters, or query for query parameters.
*
* Refer https://github.com/validatorjs/validator.js for a full list of the validators and sanitizers available.
*
* @param {typedefs.Req} req
* @param {typedefs.Res} res
* @param {typedefs.Next} next
*/
const __validator_func = async (req, res, next) => {
await body("field_name")
.notEmpty()
.withMessage("field_name not defined in body")
.run(req);
next();
}
module.exports = {
__validator_func,
};