mirror of
https://github.com/LukasKanka/api_test.git
synced 2026-11-11 06:34:36 +01:00
9 lines
314 B
JavaScript
9 lines
314 B
JavaScript
let spells = require('../controllers/spellsController.js')
|
|
|
|
exports.spell_not_found = function (req, res, next) {
|
|
let result = spells.find(spell => spell._id == req.params.spellId);
|
|
if (typeof result == 'undefined') {
|
|
return res.status(404).send({ message: "Spell not found" });
|
|
}
|
|
next();
|
|
} |