mirror of
https://github.com/20kaushik02/spotify-manager.git
synced 2025-12-06 11:54:07 +00:00
22 lines
419 B
JavaScript
22 lines
419 B
JavaScript
const { body, header, param, query } = require("express-validator");
|
|
|
|
const typedefs = require("../typedefs");
|
|
|
|
/**
|
|
* @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
|
|
}
|