Skip to content

Commit

Permalink
fix: add nickname-length exception-handling logic
Browse files Browse the repository at this point in the history
  • Loading branch information
jinlee1703 committed Oct 23, 2023
1 parent 49ad1b5 commit e067803
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,9 @@ public UserUpdateResponseDto update(String username, Long userId, UserUpdateRequ
if (!user.getId().equals(userId)) {
throw new BusinessException("수정 권한이 없습니다.", StatusEnum.FORBIDDEN);
}
if (userUpdateRequestDto.getNickname().length() < 2 || userUpdateRequestDto.getNickname().length() > 12) {
throw new BusinessException("닉네임은 2자 이상 12자 이하로 입력해주세요.", StatusEnum.BAD_REQUEST);
}
if (userUpdateRequestDto.getNickname() != null) {
if (isDuplicateNickname(userUpdateRequestDto.getNickname())) {
throw new BusinessException("이미 존재하는 닉네임입니다.", StatusEnum.CONFLICT);
Expand Down

0 comments on commit e067803

Please sign in to comment.