This commit is contained in:
evenegas
2025-10-01 12:43:37 -06:00
parent 7b8c19fbd1
commit be72ee5fa5
2 changed files with 6 additions and 5 deletions
+3 -3
View File
@@ -75,12 +75,12 @@ async cargaMasiva(@UploadedFile() file: Express.Multer.File) {
throw new BadRequestException('No se ha subido ningún archivo');
}
const cuestionarios = await this.cargaMasiva(file);
const cuestionarios = await this.cuestionarioService.cargarEventosDesdeExcel(file.path);
return {
message: 'Carga masiva exitosa',
total: cuestionarios.length,
data: cuestionarios,
total: cuestionarios.data.length,
data: cuestionarios.data,
};
}
+3 -2
View File
@@ -96,6 +96,7 @@ export class CuestionarioService {
2: 'registro-comunidad-trabajadores',
3: 'registro-general',
};
let data
const workbook = new ExcelJS.Workbook();
await workbook.xlsx.readFile(filePath);
@@ -193,11 +194,11 @@ export class CuestionarioService {
};
// Llamada a tu servicio para guardar en DB
await this.createCuestionarioEvento(createDto);
data.push(await this.createCuestionarioEvento(createDto));
}
}
return { message: 'Carga masiva completada' };
return { message: 'Carga masiva completada', data };
}
async create(createCuestionarioDto: CreateCuestionarioDto) {