32 lines
748 B
JavaScript
32 lines
748 B
JavaScript
|
|
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;
|