diff --git a/src/mail/mail.service.ts b/src/mail/mail.service.ts index 9e1b6f9..9f7f6f0 100644 --- a/src/mail/mail.service.ts +++ b/src/mail/mail.service.ts @@ -53,7 +53,7 @@ export class MailService { let resMail = await this.transporter.sendMail(mailOptions); const statusTexto = resMail.accepted.length > 0 ? "Enviado" : "Fallido"; - + /* let status = await this.statusRepository.findOne({ where: { status: statusTexto } }); @@ -70,11 +70,13 @@ export class MailService { destinatario: to, remitente: process.env.USER_GMAIL, - }); + }); */ + + if(!resMail){ throw new Error("fallo") } - this.correoRepository.save(info); + //this.correoRepository.save(info); diff --git a/src/main.ts b/src/main.ts index 11ff22b..4b9240c 100644 --- a/src/main.ts +++ b/src/main.ts @@ -6,6 +6,9 @@ import { SwaggerModule, DocumentBuilder } from '@nestjs/swagger'; async function bootstrap() { const app = await NestFactory.create(AppModule); + + app.enableCors(); + const config = new DocumentBuilder() .setTitle('Documentacion de la api de votaciones_mails v2') .setDescription(