Skip to content

Commit

Permalink
fix: 유저 정보 업데이트 삭제 (#74)
Browse files Browse the repository at this point in the history
* refactor: ♻️ validation 고도화 (#72)

* fix: 유저 정보 업데이트 삭제
  • Loading branch information
LEEJaeHyeok97 authored Sep 28, 2024
1 parent 293b702 commit 2f6ad8d
Showing 1 changed file with 1 addition and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -64,21 +64,4 @@ public UserInfoResponse getCurrentUserInfo(@Parameter(description = "Accesstoken
return userService.getUserInfo(userId);
}

@Operation(summary = "현재 유저 프로필 업데이트", description = "유저의 nickname, username, password(지난 비밀번호 검증 과정 존재) email, profileImageUrl 업데이트 기능(null 값으로 전송 시, 업데이트 X)")
@PostMapping("/profile")
public UserInfoResponse updateCurrentUserInfo(@Parameter(description = "Accesstoken을 입력해주세요.", required = true) @RequestHeader("Authorization") String token,
@Valid @RequestBody UpdateUserRequest updateUserRequest) {
if (token == null) {
throw new InvalidTokenException();
}

String jwt = token.startsWith("Bearer ") ? token.substring(7) : token;
if (!jwtUtil.validateToken(jwt)) {
throw new IllegalArgumentException("Invalid token");
}
Long userId = jwtUtil.extractId(jwt);

return userService.updateUserProfile(userId, updateUserRequest);
}

}
}

0 comments on commit 2f6ad8d

Please sign in to comment.