This commit is contained in:
TioSam77
2024-06-18 19:34:55 -06:00
parent 2be70bd806
commit 61ea72111f
+8 -5
View File
@@ -14,6 +14,7 @@ import {
import { AuthGuard } from './auth.guard';
import { AuthService } from './auth.service';
import { registerDto } from './dto/registerDto.dto';
import { UserDto } from 'src/users/dto/userDto.dto';
@Controller('auth')
export class AuthController {
@@ -36,14 +37,16 @@ export class AuthController {
return req.user;
}
@UseGuards(AuthGuard)
@Put('Modificacion/:id')
async update(@Param('id') userId: number, @Body() updateUserDto: Record<string, any>) {
return this.authService.update(userId, updateUserDto);
async update(@Param('id') id: number, @Body() updateUserDto: Record<string, any>) {
return this.authService.update(id, updateUserDto);
}
@Delete(':id')
async remove(@Param('id') userId: number) {
await this.authService.remove(userId);
@UseGuards(AuthGuard)
@Delete('Borrado/:id')
async remove(@Param('id') id: number) {
await this.authService.remove(id);
return { message: 'User successfully deleted' };
}