Subir cambios a develop
This commit is contained in:
@@ -7,6 +7,7 @@ export class AlmacenamientoController {
|
||||
|
||||
@Post()
|
||||
async create(@Body() body: { correo: string; agree: boolean }) {
|
||||
console.log('Peticion aceptada')
|
||||
if (!body.agree) {
|
||||
return { message: 'User did not agree', data: body };
|
||||
}
|
||||
|
||||
@@ -12,7 +12,9 @@ export class AlmacenamientoService {
|
||||
|
||||
// Example method to create a new record
|
||||
async create(correo: string): Promise<any> {
|
||||
const existente = await this.almacenamientoRepository.findOneBy({ correo });
|
||||
console.log(correo)
|
||||
const existente = await this.almacenamientoRepository.findOne({ where:{correo} });
|
||||
console.log(existente)
|
||||
if (!existente) {
|
||||
throw new Error("Este usuario no tiene acceso")
|
||||
}
|
||||
@@ -32,7 +34,7 @@ export class AlmacenamientoService {
|
||||
"Content-Type": "application/json",
|
||||
"Authorization": `Bearer ${process.env.TOKEN}`
|
||||
|
||||
},
|
||||
},
|
||||
body: JSON.stringify(entrada)
|
||||
})
|
||||
console.log(resonse)
|
||||
|
||||
@@ -10,7 +10,6 @@ export class Almacenamiento {
|
||||
|
||||
@Column('timestamp', {
|
||||
name: 'fecha_ampliacion',
|
||||
default: () => 'CURRENT_TIMESTAMP',
|
||||
})
|
||||
fechaConsulta: Date;
|
||||
|
||||
|
||||
@@ -133,7 +133,6 @@ import { Almacenamiento } from './almacenamiento/entity/almacenamiento.entity';
|
||||
],
|
||||
controllers: [
|
||||
AppController,
|
||||
ParticipanteController,
|
||||
InscripcionStatusController,
|
||||
],
|
||||
providers: [AppService, InscripcionStatusService],
|
||||
|
||||
@@ -1,15 +1,17 @@
|
||||
import { Body, Controller, Post } from '@nestjs/common';
|
||||
import { Body, Controller, Param, Post } from '@nestjs/common';
|
||||
import { AuthService } from './auth.service';
|
||||
import { LoginMiembroDto } from './dto/loginMiembro.dto';
|
||||
import { RegistrarMiembroDto } from './dto/registrarMiembro.dto';
|
||||
import { ApiTags } from '@nestjs/swagger';
|
||||
import { ApiPostRegistro } from './auth.docs';
|
||||
import { jwtStrategy } from './jwt.strategy';
|
||||
|
||||
@Controller('auth')
|
||||
@ApiTags('auth')
|
||||
export class AuthController {
|
||||
constructor(
|
||||
private authService: AuthService,
|
||||
private authValidar: jwtStrategy,
|
||||
) /* @InjectRepository(Usuario) private usuarioRepository: Repository<Usuario> */ {}
|
||||
|
||||
@Post('registro')
|
||||
@@ -22,4 +24,9 @@ export class AuthController {
|
||||
login(@Body() LoginUsuario: LoginMiembroDto) {
|
||||
return this.authService.login(LoginUsuario);
|
||||
}
|
||||
|
||||
@Post('validate')
|
||||
validar(@Param() token: any) {
|
||||
return this.authValidar.validate
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { Body, Controller, Param, ParseIntPipe, Post } from '@nestjs/common';
|
||||
import { Body, Controller, Get, Param, ParseIntPipe, Post } from '@nestjs/common';
|
||||
import { RegistrarParticipanteDto } from './dto/registrarParticipanteDto.dto';
|
||||
import { EventoParticipanteService } from './evento-participante.service';
|
||||
import { EventoParticipante } from './eventoParticipante.entity';
|
||||
@@ -12,5 +12,8 @@ export class EventoParticipanteController {
|
||||
return this.eventoParticipanteService.registrarParticipante(id, datos)
|
||||
}
|
||||
|
||||
|
||||
@Get()
|
||||
getEventoParticipante(): Promise<EventoParticipante[]> {
|
||||
return this.eventoParticipanteService.getEventoParticipantes();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -75,4 +75,8 @@ export class EventoParticipanteService {
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
getEventoParticipantes() {
|
||||
return this.eventoParticipanteRepository.find()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,13 @@
|
||||
import { Controller, Post } from '@nestjs/common';
|
||||
import { Controller, Get, Post } from '@nestjs/common';
|
||||
import { ParticipanteService } from './participante.service';
|
||||
import { Participante } from './participante.entity';
|
||||
|
||||
@Controller('participante')
|
||||
export class ParticipanteController {}
|
||||
export class ParticipanteController {
|
||||
constructor(private participanteService: ParticipanteService) {}
|
||||
|
||||
@Get()
|
||||
getParticipantes(): Promise<Participante[]> {
|
||||
return this.participanteService.getParticipantes();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -31,4 +31,8 @@ export class ParticipanteService {
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
getParticipantes() {
|
||||
return this.participanteRepository.find();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user