editorconfig

This commit is contained in:
2025-01-08 06:55:30 -07:00
parent 481d6fd48d
commit f75988fa3a
28 changed files with 1364 additions and 1339 deletions

View File

@@ -3,29 +3,29 @@ const { body, header, param, query } = require("express-validator");
const typedefs = require("../typedefs");
/**
* @param {typedefs.Req} req
* @param {typedefs.Res} res
* @param {typedefs.Next} next
* @param {typedefs.Req} req
* @param {typedefs.Res} res
* @param {typedefs.Next} next
*/
const createLinkValidator = async (req, res, next) => {
await body("from")
.notEmpty()
.withMessage("from not defined in body")
.isURL()
.withMessage("from must be a valid link")
.run(req);
await body("to")
.notEmpty()
.withMessage("to not defined in body")
.isURL()
.withMessage("to must be a valid link")
.run(req);
next();
await body("from")
.notEmpty()
.withMessage("from not defined in body")
.isURL()
.withMessage("from must be a valid link")
.run(req);
await body("to")
.notEmpty()
.withMessage("to not defined in body")
.isURL()
.withMessage("to must be a valid link")
.run(req);
next();
}
module.exports = {
createLinkValidator,
removeLinkValidator: createLinkValidator,
populateSingleLinkValidator: createLinkValidator,
pruneSingleLinkValidator: createLinkValidator,
createLinkValidator,
removeLinkValidator: createLinkValidator,
populateSingleLinkValidator: createLinkValidator,
pruneSingleLinkValidator: createLinkValidator,
}