1
0
mirror of https://github.com/franjsco/trackmyd-api synced 2025-06-06 00:29:14 +02:00

add remove function in controller/routes

This commit is contained in:
Francesco Esposito
2019-02-20 08:54:48 +01:00
parent 4190bb2736
commit 88d8f40ee3
2 changed files with 12 additions and 1 deletions

View File

@ -29,6 +29,16 @@ function update(req, res) {
});
}
function remove(req, res) {
Device.deleteOne({ _id: req.params.deviceId }, (err) => {
if (err) {
res.status(500).send();
}
res.status(200).send();
});
}
module.exports.index = index;
module.exports.view = view;
module.exports.update = update;
module.exports.remove = remove;