Skip to content

Commit

Permalink
refactor: null체크 메서드 변경 및 에러 메시지 어순 변경
Browse files Browse the repository at this point in the history
  • Loading branch information
parksey committed Nov 26, 2023
1 parent 7b65803 commit 94ac495
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@
import com.moabam.global.error.exception.BadRequestException;
import com.moabam.global.error.exception.ConflictException;
import com.moabam.global.error.exception.NotFoundException;
import com.moabam.global.error.model.ErrorMessage;

import io.micrometer.common.util.StringUtils;
import lombok.RequiredArgsConstructor;

@Service
Expand Down Expand Up @@ -100,8 +100,8 @@ public void modifyInfo(AuthMember authMember, ModifyMemberRequest modifyMemberRe
}

private void validateNickname(String nickname) {
if (Objects.nonNull(nickname) && memberRepository.existsByNickname(nickname)) {
throw new ConflictException(ErrorMessage.CONFLICT_NICKNAME);
if (StringUtils.isEmpty(nickname) && memberRepository.existsByNickname(nickname)) {
throw new ConflictException(NICKNAME_CONFLICT);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public enum ErrorMessage {
MEMBER_NOT_FOUND_BY_MANAGER_OR_NULL("방의 매니저거나 회원이 존재하지 않습니다."),
MEMBER_ROOM_EXCEED("참여할 수 있는 방의 개수가 모두 찼습니다."),
UNLINK_REQUEST_FAIL_ROLLBACK_SUCCESS("카카오 연결 요청 실패로 Rollback하였습니다."),
CONFLICT_NICKNAME("이미 존재하는 닉네임입니다."),
NICKNAME_CONFLICT("이미 존재하는 닉네임입니다."),

INVALID_DEFAULT_SKIN_SIZE("기본 스킨은 2개여야 합니다. 관리자에게 문의하세요"),

Expand Down

0 comments on commit 94ac495

Please sign in to comment.