listo socket
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
const moment = require('moment');
|
||||
const { convertArrayToCSV } = require('convert-array-to-csv');
|
||||
const { Op } = require('sequelize');
|
||||
const helperPath = '../../helper';
|
||||
@@ -95,12 +96,14 @@ const reporte = async (body) => {
|
||||
data.push({
|
||||
idPrestamo: res[i].idPrestamo,
|
||||
activo: res[i].activo,
|
||||
horaMaxRecoger: helper.crearDDMMAAAAHHMM(res[i].horaMaxRecoger),
|
||||
horaInicio: helper.crearDDMMAAAAHHMM(res[i].horaInicio),
|
||||
horaFin: helper.crearDDMMAAAAHHMM(res[i].horaFin),
|
||||
horaEntrega: helper.crearDDMMAAAAHHMM(res[i].horaEntrega),
|
||||
horaMaxRecoger: moment(res[i].horaMaxRecoger).format(
|
||||
'YYYY-MM-DD HH:MM'
|
||||
),
|
||||
horaInicio: moment(res[i].horaInicio).format('YYYY-MM-DD HH:MM'),
|
||||
horaFin: moment(res[i].horaFin).format('YYYY-MM-DD HH:MM'),
|
||||
horaEntrega: moment(res[i].horaEntrega).format('YYYY-MM-DD HH:MM'),
|
||||
canceladoUsuario: res[i].canceladoUsuario,
|
||||
createdAt: helper.crearDDMMAAAAHHMM(res[i].createdAt),
|
||||
createdAt: moment(res[i].createdAt).format('YYYY-MM-DD HH:MM'),
|
||||
numeroInventario: res[i].Equipo.numeroInventario,
|
||||
numeroSerie: res[i].Equipo.numeroSerie,
|
||||
sobrenombre: res[i].Equipo.sobrenombre,
|
||||
@@ -125,9 +128,7 @@ const reporte = async (body) => {
|
||||
: null,
|
||||
});
|
||||
}
|
||||
await helper.eliminarArchivo(path).catch((err) => {
|
||||
console.log(err);
|
||||
});
|
||||
await helper.eliminarArchivo(path).catch((err) => {});
|
||||
return helper.crearArchivo(path, convertArrayToCSV(data));
|
||||
})
|
||||
.then((res) => path);
|
||||
|
||||
Reference in New Issue
Block a user