const ActivoFijo = require('../../models/tablas/ActivoFijo'); const Marca = require('../../models/tablas/Marca'); const OS = require('../../models/tablas/OS'); const Ubicacion = require('../../models/tablas/Ubicacion') const UResponsable = require('../../models/tablas/UResponsable'); const Uso = require('../../models/tablas/Uso'); const get = async(req, res) => { let activosFijos = await ActivoFijo.findAll({ attributes: ['idActivoFijo', 'activoFijo'], order: ['idActivoFijo'] }) .catch((e) => { throw new Error(e) }); let marcas = await Marca.findAll({ attributes: ['idMarca', 'marca'], order: ['idMarca'] }) .catch((e) => { throw new Error(e) }); let distros = await OS.findAll({ attributes: ['idOS', 'osname'], order: ['idOS'] }) .catch((e) => { throw new Error(e) }); let ubicaciones = await Ubicacion.findAll({ attributes: ['idUbicacion', 'ubicacion'], order: ['idUbicacion'] }) .catch((e) => { throw new Error(e) }); let unidades = await UResponsable.findAll({ attributes: ['idUnidadResponsable', 'uResponsable'], order: ['idUnidadResponsable'] }) .catch((e) => { throw new Error(e) }); let usos = await Uso.findAll({ attributes: ['idUso', 'uso'], order: ['idUso'] }) .catch((e) => { throw new Error(e) }); return res.json({ activosFijos, marcas, distros, ubicaciones, unidades, usos }) }; module.exports = get;