Skip to content

Commit

Permalink
feat: #46 유저 수정 api에서 user_id 삭제
Browse files Browse the repository at this point in the history
  • Loading branch information
ChoiYongWon committed Dec 9, 2022
1 parent 2c60aa5 commit be6c1b9
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
4 changes: 0 additions & 4 deletions src/user/dto/RequestUpdateUser.dto.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@ import { IsEmail, IsString } from 'class-validator';
import { ApiProperty } from '@nestjs/swagger';

export class RequestUpdateUserDto {
@ApiProperty()
@IsString()
user_id: string;

@ApiProperty()
@IsString()
name: string;
Expand Down
4 changes: 2 additions & 2 deletions src/user/user.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ export class UserController {
@Roles([Role.User])
async patchUser(@Req() req, @Body() updateData: RequestUpdateUserDto) {
return await this.userService
.update(req.user_id, updateData)
.update(req.user.user_id, updateData)
.catch((err) => {
throw new InternalServerErrorException({
statusCode: HttpStatus.INTERNAL_SERVER_ERROR,
Expand All @@ -69,7 +69,7 @@ export class UserController {
})
@Roles([Role.User])
async removeUser(@Req() req) {
return await this.userService.delete(req.user_id).catch((err) => {
return await this.userService.delete(req.user.user_id).catch((err) => {
throw new InternalServerErrorException({
statusCode: HttpStatus.INTERNAL_SERVER_ERROR,
message: err.message,
Expand Down

0 comments on commit be6c1b9

Please sign in to comment.