diff --git a/src/participante_evento/participante_evento.service.ts b/src/participante_evento/participante_evento.service.ts index 99a1dcb..4dcafeb 100644 --- a/src/participante_evento/participante_evento.service.ts +++ b/src/participante_evento/participante_evento.service.ts @@ -229,8 +229,10 @@ export class ParticipanteEventoService { // Verificar si ya había registrado asistencia if (participanteEvento.asistio && participanteEvento.fecha_asistencia) { + //Borarr + console.log("Usuario se registro exitosamente"); return { - success: true, + success: false, message: 'El participante ya había registrado su asistencia previamente', data: { @@ -248,6 +250,8 @@ export class ParticipanteEventoService { const resultado = await this.participanteEventoRepository.save(participanteEvento); + //Borrar + console.log("El usaurio se registro exitosamente"); return { success: true, message: 'Asistencia registrada exitosamente', diff --git a/src/qr/qr-token.service.ts b/src/qr/qr-token.service.ts index 1317541..39d5309 100644 --- a/src/qr/qr-token.service.ts +++ b/src/qr/qr-token.service.ts @@ -67,23 +67,6 @@ export class QrTokenService { const decoded = this.jwtService.verify(token, { secret }); - let asistenciaEvento = await this.asistenciaRepository.findOne({ - where: { - id_participante: decoded.id_participante, - id_evento: decoded.id_evento, - } - }) - if(!asistenciaEvento){ - let newAsistencia=this.asistenciaRepository.create({estado:false,id_evento:decoded.id_evento, id_participante:decoded.id_participante}) - asistenciaEvento= await this.asistenciaRepository.save(newAsistencia) - } - - if (!asistenciaEvento?.estado) { - asistenciaEvento.estado = true - }else{ - throw new UnauthorizedException("El usuario ya se registró"); - } - // Verificar que sea un token de tipo QR de asistencia if (decoded.type !== 'qr_asistencia') { return null;