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:
@ -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;
|
||||
|
Reference in New Issue
Block a user