Skip to content

Commit

Permalink
Feat: 회원가입 시, 소프트 딜리트 고려하여 닉네임/이메일 중복여부 재확인
Browse files Browse the repository at this point in the history
  • Loading branch information
GyungA committed Jul 2, 2024
1 parent 52087aa commit 2fdc864
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,9 @@ public Users signUp(SignUpRequest signUpRequest) {

// 1-2. 이메일 중복 재확인
String email = signUpRequest.getEmail();
if (userRepository.findByEmail(email).isPresent()) {

int emailCountWithSoftDeleted = userRepository.countByEmailWithSoftDeleted(email);
if (emailCountWithSoftDeleted > 0) {
throw new ConflictException(String.format(UserMessageConstants.DUPLICATE_EMAIL_MESSAGE, email));
}

Expand Down Expand Up @@ -260,7 +262,6 @@ public MyPageResponse showMyPage(Long userId) {
}

public ValidateNicknameResponse isValidNickname(ValidateNicknameRequest validateNicknameRequest) {
// TODO: 닉네임, 이메일 중복여부 회원가입 단계에서 한 번 더 확인
String nickname = validateNicknameRequest.getNickname();

int nicknameCountWithSoftDeleted = userRepository.countByNicknameWithSoftDeleted(nickname);
Expand Down

0 comments on commit 2fdc864

Please sign in to comment.