correciones minimas endpoint get prestmo
This commit is contained in:
@@ -5,6 +5,7 @@ const Equipo = require(`${dbPath}/Equipo`);
|
||||
const Modulo = require(`${dbPath}/Modulo`);
|
||||
// const Operador = require(`${dbPath}/Operador`);
|
||||
const Prestamo = require(`${dbPath}/Prestamo`);
|
||||
const Programa = require(`${dbPath}/Programa`);
|
||||
const TipoCarrito = require(`${dbPath}/TipoCarrito`);
|
||||
const Usuario = require(`${dbPath}/Usuario`);
|
||||
|
||||
@@ -20,6 +21,7 @@ const historialUsuario = async (body) => {
|
||||
model: Carrito,
|
||||
include: [{ model: TipoCarrito }, { model: Modulo }],
|
||||
},
|
||||
{ model: Programa },
|
||||
],
|
||||
},
|
||||
{ model: Usuario, where: { idUsuario } },
|
||||
@@ -27,15 +29,17 @@ const historialUsuario = async (body) => {
|
||||
],
|
||||
}).then((res) => {
|
||||
for (let i = 0; i < res.length; i++) {
|
||||
delete res[i].dataValues.idUsuario;
|
||||
delete res[i].dataValues.idOperadorEntrega;
|
||||
delete res[i].dataValues.idOperadorRegreso;
|
||||
delete res[i].dataValues.idUsuario;
|
||||
delete res[i].dataValues.idEquipo;
|
||||
delete res[i].dataValues.Equipo.dataValues.idPrograma;
|
||||
delete res[i].dataValues.Equipo.dataValues.idStatus;
|
||||
delete res[i].dataValues.Usuario;
|
||||
delete res[i].dataValues.Usuario;
|
||||
delete res[i].dataValues.Equipo.dataValues.idCarrito;
|
||||
delete res[i].dataValues.Equipo.Carrito.dataValues.idTipoCarrito;
|
||||
delete res[i].dataValues.Equipo.Carrito.dataValues.idModulo;
|
||||
delete res[i].dataValues.Equipo.dataValues.idStatus;
|
||||
delete res[i].dataValues.Equipo.dataValues.idPrograma;
|
||||
if (!res[i].Equipo.Programa)
|
||||
delete res[i].dataValues.Equipo.dataValues.Programa;
|
||||
}
|
||||
return { historialUsuario: res };
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user