listo
This commit is contained in:
@@ -1,10 +1,8 @@
|
||||
const validar = require('../../helper/validar');
|
||||
const dbPath = '../../db/tablas';
|
||||
const Infraccion = require(`${dbPath}/Infraccion`);
|
||||
const Multa = require(`${dbPath}/Multa`);
|
||||
const Operador = require(`${dbPath}/Operador`);
|
||||
const Prestamo = require(`${dbPath}/Prestamo`);
|
||||
const Usuario = require(`${dbPath}/Usuario`);
|
||||
|
||||
const historialMultasEquipo = async (body) => {
|
||||
const idEquipo = validar.validarId(body.idEquipo);
|
||||
@@ -15,9 +13,7 @@ const historialMultasEquipo = async (body) => {
|
||||
{
|
||||
model: Prestamo,
|
||||
where: { idEquipo },
|
||||
include: [{ model: Usuario }],
|
||||
},
|
||||
{ model: Infraccion },
|
||||
{ model: Operador, as: 'OperadorMulta' },
|
||||
],
|
||||
limit: 25,
|
||||
@@ -36,12 +32,6 @@ const historialMultasEquipo = async (body) => {
|
||||
delete res.rows[i].dataValues.Prestamo.dataValues.idOperadorCancelacion;
|
||||
delete res.rows[i].dataValues.Prestamo.dataValues.idUsuario;
|
||||
delete res.rows[i].dataValues.Prestamo.dataValues.idEquipo;
|
||||
delete res.rows[i].dataValues.Prestamo.dataValues.Usuario.dataValues
|
||||
.password;
|
||||
delete res.rows[i].dataValues.Prestamo.dataValues.Usuario.dataValues
|
||||
.idTipoUsuario;
|
||||
delete res.rows[i].dataValues.Prestamo.dataValues.Usuario.dataValues
|
||||
.idCarrera;
|
||||
}
|
||||
return { count: res.count, historialMultasEquipo: res.rows };
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user