organización de endpoints
This commit is contained in:
@@ -1,8 +1,9 @@
|
||||
const fs = require('fs');
|
||||
const moment = require('moment');
|
||||
const { convertArrayToCSV } = require('convert-array-to-csv');
|
||||
const { Op } = require('sequelize');
|
||||
const validar = require('../../helper/validar');
|
||||
const helperPath = '../../helper';
|
||||
const helper = require(`${helperPath}/helper`);
|
||||
const validar = require(`${helperPath}/validar`);
|
||||
const dbPath = '../../db/tablas';
|
||||
const Carrera = require(`${dbPath}/Carrera`);
|
||||
const Servicio = require(`${dbPath}/Servicio`);
|
||||
@@ -32,12 +33,12 @@ const gustavoBazPrada = async (body) => {
|
||||
nombre: res[i].Usuario.nombre,
|
||||
licenciatura: res[i].Carrera.carrera,
|
||||
correo: res[i].correo,
|
||||
fechaLiberacion: validar.crearDDMMAAAA(res[i].fechaLiberacion),
|
||||
fechaLiberacion: helper.crearDDMMAAAA(res[i].fechaLiberacion),
|
||||
});
|
||||
await validar.eliminarArchivo(path).catch((err) => {
|
||||
await helper.eliminarArchivo(path).catch((err) => {
|
||||
console.log(err);
|
||||
});
|
||||
return validar.crearArchivo(path, convertArrayToCSV(data));
|
||||
return helper.crearArchivo(path, convertArrayToCSV(data));
|
||||
})
|
||||
.then((res) => {
|
||||
return path;
|
||||
|
||||
Reference in New Issue
Block a user