arreglo en tablas y controllers
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ export class Contacto {
|
||||
id_contacto: number
|
||||
|
||||
@Column({nullable:false})
|
||||
correo: string
|
||||
email: string
|
||||
|
||||
@Column()
|
||||
horario: string
|
||||
|
||||
@@ -18,5 +18,5 @@ export class RegistrarParticipanteDto {
|
||||
carrera: string;
|
||||
|
||||
@IsEmail()
|
||||
correo: string;
|
||||
email: string;
|
||||
}
|
||||
|
||||
@@ -19,8 +19,8 @@ export class EventoParticipanteService {
|
||||
private eventoParticipanteRepository: Repository<EventoParticipante>,
|
||||
) {}
|
||||
|
||||
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);
|
||||
|
||||
@@ -5,6 +5,7 @@ export class crearEventoDto {
|
||||
proyecto: string[];
|
||||
modalidad: string[];
|
||||
lugar: string;
|
||||
cupo: number;
|
||||
requisitos: string;
|
||||
cuota_inscripcion: number;
|
||||
patrocinador: string;
|
||||
|
||||
@@ -32,6 +32,9 @@ export class Evento {
|
||||
@Column({ nullable: false })
|
||||
lugar: string;
|
||||
|
||||
@Column({nullable: false})
|
||||
cupo: number;
|
||||
|
||||
@Column({ nullable: false })
|
||||
requisitos: string;
|
||||
|
||||
|
||||
@@ -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 =
|
||||
|
||||
@@ -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);
|
||||
});
|
||||
|
||||
@@ -33,7 +33,7 @@ export class Miembro {
|
||||
|
||||
@Column({ nullable: false })
|
||||
@IsEmail()
|
||||
correo: string;
|
||||
email: string;
|
||||
|
||||
@Column({ nullable: false, length: 40 })
|
||||
password: string;
|
||||
|
||||
@@ -19,7 +19,7 @@ export class Participante {
|
||||
telefono: string;
|
||||
|
||||
@Column({ nullable: false })
|
||||
correo: string;
|
||||
email: string;
|
||||
|
||||
@Column({ nullable: true }) //
|
||||
password: string;
|
||||
|
||||
@@ -11,16 +11,16 @@ export class ParticipanteService {
|
||||
private participanteRepository: Repository<Participante>,
|
||||
) {}
|
||||
|
||||
async participanteExiste(correo: string): Promise<Participante> {
|
||||
async participanteExiste(email: string): Promise<Participante> {
|
||||
/* 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');
|
||||
|
||||
Reference in New Issue
Block a user