mirror of
https://github.com/franjsco/trackmyd-api
synced 2025-06-06 00:29:14 +02:00
add update function in controller/routes
This commit is contained in:
@ -20,5 +20,15 @@ function view(req, res) {
|
||||
});
|
||||
}
|
||||
|
||||
function update(req, res) {
|
||||
Device.findOneAndUpdate({ _id: req.params.deviceId }, req.body, (err) => {
|
||||
if (err) {
|
||||
res.status(500).send();
|
||||
}
|
||||
res.status(200).send();
|
||||
});
|
||||
}
|
||||
|
||||
module.exports.index = index;
|
||||
module.exports.view = view;
|
||||
module.exports.update = update;
|
||||
|
Reference in New Issue
Block a user