Fixing back borrar
This commit is contained in:
@@ -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' };
|
||||
|
||||
Reference in New Issue
Block a user