Varios archivos de backend agregados.
This commit is contained in:
@@ -0,0 +1,62 @@
|
||||
const ActivoFijo = require('../../models/tablas/ActivoFijo');
|
||||
const Marca = require('../../models/tablas/Marca');
|
||||
const OS = require('../../models/tablas/OS');
|
||||
const Tipo = require('../../models/tablas/Tipo');
|
||||
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 tipos = await Tipo.findAll({
|
||||
attributes: ['idTipo', 'tipo'],
|
||||
order: ['idTipo']
|
||||
})
|
||||
.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;
|
||||
Reference in New Issue
Block a user