const sequelize = require('../../../config/sequelize.conf'); const { QueryTypes } = require('sequelize'); const get = async(req, res) => { await sequelize.query(` SELECT I.noInventario, T.tipo, P.modelo, M.marca, P.noSerie, P. descripcion FROM inventario I INNER JOIN printers P ON P.noInventario = I.noInventario INNER JOIN marca M ON M.idMarca = P.idMarca INNER JOIN tipo T ON T.idTipo = P.idTipo ORDER BY P.createdAt DESC `, { type: QueryTypes.SELECT }) .then(printers => { return res.json({ printers }); }) .catch(error => res.status(500).json({ error })); } module.exports = get;