carrera en cuestionarios programa

This commit is contained in:
2022-03-11 11:22:40 -06:00
parent a750f1f71b
commit efb4a7c374
2 changed files with 5 additions and 6 deletions
+1 -3
View File
@@ -76,9 +76,7 @@ const get = async (body) => {
});
return helper.crearArchivo(path, convertArrayToCSV(data));
})
.then((res) => {
return path;
});
.then((res) => path);
};
module.exports = get;
@@ -5,6 +5,7 @@ const helperPath = '../../helper';
const helper = require(`${helperPath}/helper`);
const { validarNumero } = require(`${helperPath}/validar`);
const dbPath = '../../db/tablas';
const Carrera = require(`${dbPath}/Carrera`);
const CuestionarioPrograma = require(`${dbPath}/CuestionarioPrograma`);
const Servicio = require(`${dbPath}/Servicio`);
const Programa = require(`${dbPath}/Programa`);
@@ -23,6 +24,7 @@ const get = async (body) => {
},
{ model: Programa, where: { clavePrograma: { [Op.like]: `${year}-%` } } },
{ model: Usuario },
{ model: Carrera },
],
order: [['createdAt']],
})
@@ -33,6 +35,7 @@ const get = async (body) => {
clavePrograma: res[i].Programa.clavePrograma,
usuario: res[i].Usuario.usuario,
nombre: res[i].Usuario.nombre,
carrera: res[i].Carrera.carrera,
idCuestionarioPrograma:
res[i].CuestionarioPrograma.idCuestionarioPrograma,
actividad1: res[i].CuestionarioPrograma.actividad1,
@@ -50,9 +53,7 @@ const get = async (body) => {
});
return helper.crearArchivo(path, convertArrayToCSV(data));
})
.then((res) => {
return path;
});
.then((res) => path);
};
module.exports = get;