Skip to content

Commit

Permalink
🐛 Fix editProfile nickname conflict check
Browse files Browse the repository at this point in the history
  • Loading branch information
wonseok committed Jan 31, 2025
1 parent 3617a62 commit c335454
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ class ProfileService(
user: User,
request: EditProfileRequest,
): Profile {
if (userService.existUserEntityByNickname(request.nickname)) {
if (user.nickname == request.nickname) {
throw ProfileEditNicknameConflictException()
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -179,9 +179,4 @@ class UserService(
fun getUserEntityByNickname(nickname: String): UserEntity {
return userRepository.findByNickname(nickname) ?: throw UserNotFoundException()
}

@Transactional
fun existUserEntityByNickname(nickname: String): Boolean {
return userRepository.existsByNickname(nickname)
}
}

0 comments on commit c335454

Please sign in to comment.