Se modifico el qr y la carga masiva
This commit is contained in:
@@ -45,8 +45,6 @@ export class CuestionarioController {
|
||||
destination: './uploads/banners',
|
||||
filename: (req, file, cb) => {
|
||||
cb(null, file.originalname);
|
||||
|
||||
|
||||
},
|
||||
}),
|
||||
fileFilter: (req, file, cb) => {
|
||||
|
||||
@@ -56,6 +56,10 @@ export class CuestionarioService {
|
||||
|
||||
|
||||
private mapTipoPregunta(tipo: string): TipoPreguntaEnum {
|
||||
if (!tipo) {
|
||||
console.log(tipo);
|
||||
throw new Error('El campo "tipo de pregunta" está vacío en el Excel');
|
||||
}
|
||||
switch (tipo.toLowerCase()) {
|
||||
case 'cerrada': return TipoPreguntaEnum.Cerrada;
|
||||
case 'multiple': return TipoPreguntaEnum.Multiple;
|
||||
@@ -132,7 +136,6 @@ export class CuestionarioService {
|
||||
|
||||
const plantilla = qRow.getCell(9).value ? Number(row.getCell(8).value) : null;
|
||||
|
||||
|
||||
if (plantilla && PLANTILLA_MAP[plantilla]) {
|
||||
const fecha_inicio = new Date(qRow.getCell(4).value as string);
|
||||
const fecha_fin = new Date(qRow.getCell(5).value as string);
|
||||
@@ -145,12 +148,9 @@ export class CuestionarioService {
|
||||
fecha_inicio,
|
||||
fecha_fin,
|
||||
id_tipo_evento,
|
||||
|
||||
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
// Filtrar secciones de este cuestionario
|
||||
const secciones = seccionesSheet.getRows(2, seccionesSheet.rowCount - 1)
|
||||
?.filter(sRow => sRow.getCell(2).value === qRow.getCell(1).value)
|
||||
@@ -163,6 +163,9 @@ export class CuestionarioService {
|
||||
?.filter(oRow => oRow.getCell(2).value === pRow.getCell(1).value)
|
||||
.map(oRow => ({ valor: oRow.getCell(3).value as string })) || [];
|
||||
|
||||
console.log("Este es el titulo: ", pRow.getCell(3).value as string);
|
||||
console.log("Este es el tipo de la pregunta: ",pRow.getCell(4).value as string);
|
||||
|
||||
return {
|
||||
titulo: pRow.getCell(3).value as string,
|
||||
tipo: this.mapTipoPregunta(pRow.getCell(4).value as string),
|
||||
|
||||
Reference in New Issue
Block a user