This commit is contained in:
Lemuel Marquez
2021-01-13 12:00:11 -06:00
parent ff6699ff20
commit 5de85194fe
8 changed files with 53 additions and 75 deletions
+3 -2
View File
@@ -16,6 +16,7 @@ const serviciosAdmin = async (body) => {
? validar.validarNumeroCuenta(body.numeroCuenta)
: '';
let where = {};
let data = [];
if (idStatus) where.idStatus = idStatus;
return Servicio.findAll({
@@ -32,14 +33,14 @@ const serviciosAdmin = async (body) => {
{ model: Carrera },
{ model: Status },
],
order: [['updatedAt', 'DESC']],
}).then((res) => {
let data = [];
for (let i = pagina * 25 - 25; i < res.length && i < pagina * 25; i++)
data.push({
idServicio: res[i].idServicio,
fechaInicio: res[i].fechaInicio,
fechaFin: res[i].fechaFin,
createdAt: res[i].createdAt,
Usuario: {
idUsuario: res[i].Usuario.idUsuario,
usuario: res[i].Usuario.usuario,