/updateEquip and /updatePrinter added and working.
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
const sequelize = require('../../config/sequelize.conf');
|
||||
|
||||
const { QueryTypes } = require('sequelize');
|
||||
|
||||
const get = async(req, res) => {
|
||||
const noInventario = req.query.noInventario;
|
||||
|
||||
await sequelize.query(`
|
||||
SELECT I.noInventario, E.idActivoFijo, E.modelo, E.idMarca, E.noSerie, E.procesador, E.vProcesador, E.hdd, E.memoriasz, E.memoria, E.vMemoria, E.graficos, E.idOS, I.idUnidadResponsable, I.idUbicacion, I.idUso, I.noResguardo
|
||||
FROM inventario I, equipo E
|
||||
WHERE I.noInventario = E.noInventario
|
||||
AND I.noInventario = :noInventario
|
||||
`, {
|
||||
replacements: { noInventario },
|
||||
type: QueryTypes.SELECT
|
||||
})
|
||||
.then(equipo => {
|
||||
return res.json({
|
||||
equipo
|
||||
})
|
||||
})
|
||||
.catch(error => res.status(500).json({
|
||||
error
|
||||
}));
|
||||
};
|
||||
|
||||
module.exports = get;
|
||||
Reference in New Issue
Block a user