Se corrigio cuestionario alumno
This commit is contained in:
@@ -21,7 +21,7 @@ export class CuestionarioAlumno2Service {
|
||||
private cuestionarioAlumnoRepository: Repository<CuestionarioAlumno>,
|
||||
private validacionService: ValidacionService,
|
||||
private archivoService: ArchivoService,
|
||||
) {}
|
||||
) { }
|
||||
|
||||
async create(createCuestionarioAlumno2Dto: CreateCuestionarioAlumno2Dto) {
|
||||
let idServicio = createCuestionarioAlumno2Dto.idServicio;
|
||||
@@ -32,6 +32,7 @@ export class CuestionarioAlumno2Service {
|
||||
|
||||
let servicio = await this.servicioRepository.findOne({
|
||||
where: { idServicio },
|
||||
relations: ['cuestionarioAlumno2', 'status'],
|
||||
});
|
||||
if (!servicio) {
|
||||
throw new Error('No existe este Servicio Social.');
|
||||
@@ -69,45 +70,45 @@ export class CuestionarioAlumno2Service {
|
||||
return resX;
|
||||
}
|
||||
|
||||
/*
|
||||
async get(version: string, anio: string) {
|
||||
const year = anio;
|
||||
const path = `server/uploads/${year}_cuestionario_alumno.csv`;
|
||||
|
||||
let data = [];
|
||||
|
||||
console.log(year);
|
||||
let temp;
|
||||
|
||||
if (version == 'v1') {
|
||||
temp = await this.cuestionarioAlumnoRepository.find({
|
||||
where: {
|
||||
idCuestionarioAlumno: Not(IsNull()),
|
||||
},
|
||||
/*
|
||||
async get(version: string, anio: string) {
|
||||
const year = anio;
|
||||
const path = `server/uploads/${year}_cuestionario_alumno.csv`;
|
||||
|
||||
let data = [];
|
||||
|
||||
console.log(year);
|
||||
let temp;
|
||||
|
||||
if (version == 'v1') {
|
||||
temp = await this.cuestionarioAlumnoRepository.find({
|
||||
where: {
|
||||
idCuestionarioAlumno: Not(IsNull()),
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
if (version == 'v2') {
|
||||
temp = await this.cuestionarioAlumno2Repository.find({
|
||||
where: {
|
||||
idCuestionarioAlumno2: Not(IsNull()),
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
if (!temp) {
|
||||
throw new Error();
|
||||
}
|
||||
|
||||
data = temp.map((item) => ({ ...item }));
|
||||
|
||||
await this.archivoService.eliminarArchivo(path).catch((err) => {
|
||||
console.log(err);
|
||||
});
|
||||
|
||||
return this.archivoService.crearArchivo(path, convertArrayToCSV(data));
|
||||
}
|
||||
|
||||
if (version == 'v2') {
|
||||
temp = await this.cuestionarioAlumno2Repository.find({
|
||||
where: {
|
||||
idCuestionarioAlumno2: Not(IsNull()),
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
if (!temp) {
|
||||
throw new Error();
|
||||
}
|
||||
|
||||
data = temp.map((item) => ({ ...item }));
|
||||
|
||||
await this.archivoService.eliminarArchivo(path).catch((err) => {
|
||||
console.log(err);
|
||||
});
|
||||
|
||||
return this.archivoService.crearArchivo(path, convertArrayToCSV(data));
|
||||
}
|
||||
*/
|
||||
*/
|
||||
async get(version: string, anio: string): Promise<string> {
|
||||
const path = `server/uploads/${anio}_cuestionario_alumno.csv`;
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ export class CreateCuestionarioAlumno2Dto {
|
||||
|
||||
@IsNumber()
|
||||
@IsNotEmpty()
|
||||
idServicio:number
|
||||
idServicio: number
|
||||
|
||||
|
||||
@IsString()
|
||||
|
||||
@@ -1204,17 +1204,17 @@ export class ServicioService {
|
||||
}
|
||||
|
||||
if (!correoResponsable || !emailResponsable) {
|
||||
throw new InternalServerErrorException(
|
||||
'Error al generar correo para el responsable',
|
||||
);
|
||||
}
|
||||
throw new InternalServerErrorException(
|
||||
'Error al generar correo para el responsable',
|
||||
);
|
||||
}
|
||||
|
||||
await this.gmailService.enviarCorreo({
|
||||
subject: correoResponsable.subject,
|
||||
to: emailResponsable,
|
||||
text: correoResponsable.msj,
|
||||
fecha_recibido: new Date(),
|
||||
});
|
||||
await this.gmailService.enviarCorreo({
|
||||
subject: correoResponsable.subject,
|
||||
to: emailResponsable,
|
||||
text: correoResponsable.msj,
|
||||
fecha_recibido: new Date(),
|
||||
});
|
||||
|
||||
// await this.gmailService.enviarCorreo({
|
||||
// subject: correoResponsable.subject,
|
||||
|
||||
Reference in New Issue
Block a user