diff --git a/.env b/.env index cc0937e..2980646 100644 --- a/.env +++ b/.env @@ -2,7 +2,7 @@ PORT=5089 DB_HOST=localhost DB_USER=root -DB_PASSWORD=password +DB_PASSWORD=Dosmiluno2001 DB_NAME=cedetec_proyectos DB_PORT=3306 diff --git a/src/contacto/entity/contacto.entity.ts b/src/contacto/entity/contacto.entity.ts index 854cd13..9ce9207 100644 --- a/src/contacto/entity/contacto.entity.ts +++ b/src/contacto/entity/contacto.entity.ts @@ -8,7 +8,7 @@ export class Contacto { id_contacto: number @Column({nullable:false}) - correo: string + email: string @Column() horario: string diff --git a/src/evento-participante/evento-participante/dto/registrarParticipanteDto.dto.ts b/src/evento-participante/evento-participante/dto/registrarParticipanteDto.dto.ts index 7ab0048..04ebcf5 100644 --- a/src/evento-participante/evento-participante/dto/registrarParticipanteDto.dto.ts +++ b/src/evento-participante/evento-participante/dto/registrarParticipanteDto.dto.ts @@ -18,5 +18,5 @@ export class RegistrarParticipanteDto { carrera: string; @IsEmail() - correo: string; + email: string; } diff --git a/src/evento-participante/evento-participante/evento-participante.service.ts b/src/evento-participante/evento-participante/evento-participante.service.ts index 2908175..327d555 100644 --- a/src/evento-participante/evento-participante/evento-participante.service.ts +++ b/src/evento-participante/evento-participante/evento-participante.service.ts @@ -19,8 +19,8 @@ export class EventoParticipanteService { private eventoParticipanteRepository: Repository, ) {} - participanteExiste(correo: string) { - return this.participanteRepository.findOne({ where: { correo } }); + participanteExiste(email: string) { + return this.participanteRepository.findOne({ where: { email } }); } async registrarEnEvento( @@ -28,7 +28,7 @@ export class EventoParticipanteService { registrarParticipanteDto: RegistrarParticipanteDto, ) { const participante = await this.participanteExiste( - registrarParticipanteDto.correo, + registrarParticipanteDto.email, ); /* console.log(id_evento); console.log(participante); */ @@ -48,7 +48,7 @@ export class EventoParticipanteService { ) { /* console.log(id_evento); console.log(registrarParticipanteDto); */ - return this.participanteExiste(registrarParticipanteDto.correo).then( + return this.participanteExiste(registrarParticipanteDto.email).then( (res) => { if (res) { this.registrarEnEvento(id_evento, res); diff --git a/src/eventos/dto/crearEvento.dto.ts b/src/eventos/dto/crearEvento.dto.ts index 14b499b..51e66fe 100644 --- a/src/eventos/dto/crearEvento.dto.ts +++ b/src/eventos/dto/crearEvento.dto.ts @@ -5,6 +5,7 @@ export class crearEventoDto { proyecto: string[]; modalidad: string[]; lugar: string; + cupo: number; requisitos: string; cuota_inscripcion: number; patrocinador: string; diff --git a/src/eventos/evento.entity.ts b/src/eventos/evento.entity.ts index 5d2639c..7b46a7e 100644 --- a/src/eventos/evento.entity.ts +++ b/src/eventos/evento.entity.ts @@ -32,6 +32,9 @@ export class Evento { @Column({ nullable: false }) lugar: string; + @Column({nullable: false}) + cupo: number; + @Column({ nullable: false }) requisitos: string; diff --git a/src/inscripcion-dsc/inscripcion-dsc.controller.ts b/src/inscripcion-dsc/inscripcion-dsc.controller.ts index 85a14e8..23419ed 100644 --- a/src/inscripcion-dsc/inscripcion-dsc.controller.ts +++ b/src/inscripcion-dsc/inscripcion-dsc.controller.ts @@ -16,8 +16,7 @@ export class InscripcionDscController { async confirmacionDsc(@Body() body: any) { const { accountNumber } = body; - const verificado = await this.inscripcionService.userVerification(accountNumber) - console.log(verificado) + this.inscripcionService.userVerification(accountNumber) /* try { const userVerificationResponse = diff --git a/src/inscripcion-dsc/inscripcion-dsc.service.ts b/src/inscripcion-dsc/inscripcion-dsc.service.ts index fbbd72e..5daa0b9 100644 --- a/src/inscripcion-dsc/inscripcion-dsc.service.ts +++ b/src/inscripcion-dsc/inscripcion-dsc.service.ts @@ -18,10 +18,8 @@ export class InscripcionDscService { JOIN periodo P ON (P.id_periodo = AI.id_periodo) WHERE A.id_cuenta = "${accountNumber}" and P.activo=true`; - console.log(userInformationQuery); - connection.connect(); - connection.query(userInformationQuery, function (error, results, fields) { + connection.query('SELECT * FROM alumno;', function (error, results, fields) { if (error) throw error; console.log('The solution is: ', results); }); diff --git a/src/miembro/entity/miembro.entity.ts b/src/miembro/entity/miembro.entity.ts index e4ee23a..a1e5807 100644 --- a/src/miembro/entity/miembro.entity.ts +++ b/src/miembro/entity/miembro.entity.ts @@ -33,7 +33,7 @@ export class Miembro { @Column({ nullable: false }) @IsEmail() - correo: string; + email: string; @Column({ nullable: false, length: 40 }) password: string; diff --git a/src/participante/participante.entity.ts b/src/participante/participante.entity.ts index 59774af..8df05e5 100644 --- a/src/participante/participante.entity.ts +++ b/src/participante/participante.entity.ts @@ -19,7 +19,7 @@ export class Participante { telefono: string; @Column({ nullable: false }) - correo: string; + email: string; @Column({ nullable: true }) // password: string; diff --git a/src/participante/participante.service.ts b/src/participante/participante.service.ts index 4f1ae5c..1112e1f 100644 --- a/src/participante/participante.service.ts +++ b/src/participante/participante.service.ts @@ -11,16 +11,16 @@ export class ParticipanteService { private participanteRepository: Repository, ) {} - async participanteExiste(correo: string): Promise { + async participanteExiste(email: string): Promise { /* const participante = await this.participanteRepository.findOne({ where: { correo: correo }, }); return participante !== undefined; */ - return this.participanteRepository.findOne({ where: { correo } }); + return this.participanteRepository.findOne({ where: { email } }); } async registrarParticipante(registrarParticipanteDto: RegistrarParticipanteDto) { - return this.participanteExiste(registrarParticipanteDto.correo).then( + return this.participanteExiste(registrarParticipanteDto.email).then( (participante) => { if (participante) { throw new ConflictException('Este usuario ya está registrado');