init from origin + update

This commit is contained in:
2023-08-01 13:14:02 +03:00
commit 321dc4c3c5
1109 changed files with 16019 additions and 0 deletions

View File

@@ -0,0 +1,12 @@
const checkRequiredMidleware = (options) => (req, res, next) => {
// eslint-disable-next-line no-restricted-syntax
for (const option of options) {
if (!req.body[option]) {
res.status(400).send(`Required field ${option} is not present`)
return
}
}
next()
}
module.exports = checkRequiredMidleware