se cambio la descarga de a csv y subida de archivos

This commit is contained in:
evenegas
2025-07-02 10:19:00 -06:00
parent 4510999453
commit 95d4fa506c
2 changed files with 184 additions and 232 deletions
+13 -13
View File
@@ -148,13 +148,13 @@ export class ExcelController {
origen,
'SUCCESS',
undefined,
'descarga de csv',
`size=${csv.length}`
);
return res
.status(HttpStatus.OK)
.header('Content-Type', 'text/tab-separated-values')
.header('Content-Disposition', 'attachment; filename="usuarios_solicita.tsv"')
.header('Content-Type', 'text/csv')
.header('Content-Disposition', 'attachment; filename="usuarios_solicita.csv"')
.send(csv);
} catch (err) {
await this.movimientoService.log(
@@ -166,20 +166,20 @@ export class ExcelController {
.status(HttpStatus.FORBIDDEN)
.json({ statusCode: 403, message: 'Origen no permitido para descarga.' });
}
} else if (origen == 'CORREO') {
} else if (origen == 'CORREO' || origen == 'LOAD') {
try {
const csv = await this.excelService.generateCsvCorreo();
await this.movimientoService.log(
origen,
'SUCCESS',
undefined,
'descarga de csv',
`size=${csv.length}`
);
return res
.status(HttpStatus.OK)
.header('Content-Type', 'text/tab-separated-values')
.header('Content-Disposition', 'attachment; filename="usuarios.tsv"')
.header('Content-Type', 'text/csv')
.header('Content-Disposition', 'attachment; filename="usuarios_correo.csv"')
.send(csv);
} catch (err) {
await this.movimientoService.log(
@@ -199,13 +199,13 @@ export class ExcelController {
origen,
'SUCCESS',
undefined,
'descarga de csv',
`size=${csv.length}`
);
return res
.status(HttpStatus.OK)
.header('Content-Type', 'text/tab-separated-values')
.header('Content-Disposition', 'attachment; filename="usuarios_at.tsv"')
.header('Content-Type', 'text/csv')
.header('Content-Disposition', 'attachment; filename="usuarios_AT.csv"')
.send(csv);
} catch (err) {
await this.movimientoService.log(
@@ -225,13 +225,13 @@ export class ExcelController {
origen,
'SUCCESS',
undefined,
'descarga de csv',
`size=${csv.length}`
);
return res
.status(HttpStatus.OK)
.header('Content-Type', 'text/tab-separated-values')
.header('Content-Disposition', 'attachment; filename="usuarios_red.tsv"')
.header('Content-Type', 'text/csv')
.header('Content-Disposition', 'attachment; filename="usuarios_red.csv"')
.send(csv);
} catch (err) {
await this.movimientoService.log(