32 lines
739 B
JavaScript
32 lines
739 B
JavaScript
const Inventario = require('../../models/tablas/Inventario');
|
|
const Equipo = require('../../models/tablas/Equipo');
|
|
|
|
const remove = async(req, res) => {
|
|
const noInventario = req.body.noInventario;
|
|
|
|
await Inventario.destroy({
|
|
where: {
|
|
noInventario
|
|
}
|
|
})
|
|
.catch(e => res.status(500).json({
|
|
ok: false,
|
|
err
|
|
}));
|
|
|
|
await Equipo.destroy({
|
|
where: {
|
|
noInventario
|
|
}
|
|
})
|
|
.then(() => res.json({
|
|
ok: true,
|
|
message: 'Eliminado con éxito'
|
|
}))
|
|
.catch(err => res.status(500).json({
|
|
ok: false,
|
|
err
|
|
}));
|
|
}
|
|
|
|
module.exports = remove; |