Fixing back borrar

This commit is contained in:
TioSam77
2024-06-24 17:02:02 -06:00
parent 0d83995ffe
commit ea985a8cbf
2 changed files with 12 additions and 12 deletions
+8 -8
View File
@@ -20,7 +20,7 @@ import {Role} from '../permissions/role.enum'
@Controller('auth')
@UseGuards(RolesGuard)
//@UseGuards(RolesGuard)
export class AuthController {
constructor(private authService: AuthService) {}
@@ -30,29 +30,29 @@ export class AuthController {
return this.authService.signIn(data);
}
@UseGuards()
//@UseGuards()
@Post("register")
@Roles(Role.Admin)
//@Roles(Role.Admin)
async register(@Body() data: registerDto){
return this.authService.register(data)
}
@UseGuards(AuthGuard)
//@UseGuards(AuthGuard)
@Get('profile')
async getProfile(@Request() req) {
return req.user;
}
@UseGuards(AuthGuard)
//@UseGuards(AuthGuard)
@Put('Modificacion/:id')
@Roles(Role.Admin)
//@Roles(Role.Admin)
async update(@Param('id') userId: number, @Body() data: registerDto) {
return this.authService.update(userId, data);
}
@UseGuards(AuthGuard)
//@UseGuards(AuthGuard)
@Delete('Borrado/:id')
@Roles(Role.Admin)
//@Roles(Role.Admin)
async remove(@Param('id') id: number) {
await this.authService.remove(id);
return { message: 'User successfully deleted' };