/updateEquip and /updatePrinter added and working.
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
const Inventario = require('../../models/tablas/Inventario');
|
||||
const Printers = require('../../models/tablas/Printers');
|
||||
|
||||
const remove = async(req, res) => {
|
||||
const noInventario = req.body.noInventario;
|
||||
|
||||
await Inventario.destroy({
|
||||
where: {
|
||||
noInventario
|
||||
}
|
||||
})
|
||||
.catch(err => res.status(500).json({
|
||||
ok: false,
|
||||
err
|
||||
}));
|
||||
|
||||
await Printers.destroy({
|
||||
where: {
|
||||
noInventario
|
||||
}
|
||||
})
|
||||
.then(() => res.json({
|
||||
ok: true,
|
||||
message: 'Impresora eliminada.'
|
||||
}))
|
||||
.catch(err => res.status(500).json({
|
||||
ok: false,
|
||||
err
|
||||
}));
|
||||
};
|
||||
|
||||
module.exports = remove;
|
||||
Reference in New Issue
Block a user