Skip to content

Commit

Permalink
Merge pull request #277 from CaZaIt/feature-user
Browse files Browse the repository at this point in the history
중복확인 API 수정
  • Loading branch information
mjKim1229 authored May 22, 2023
2 parents ea162c1 + 03636a6 commit cacd0ea
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import static shop.cazait.global.error.status.ErrorStatus.INVALID_JWT;
import static shop.cazait.global.error.status.ErrorStatus.NOT_EXIST_USER;
import static shop.cazait.global.error.status.ErrorStatus.NOT_EXPIRED_TOKEN;
import static shop.cazait.global.error.status.SuccessStatus.SIGNUP_AVAILABLE;
import static shop.cazait.global.error.status.SuccessStatus.SUCCESS;

import java.security.InvalidAlgorithmParameterException;
Expand Down Expand Up @@ -151,15 +152,15 @@ public SuccessResponse<String> checkduplicateEmail(PostCheckDuplicateEmailReq po
if (!userRepository.findByEmail(email).isEmpty()) {
throw new UserException(EXIST_EMAIL);
}
return new SuccessResponse(SUCCESS, "회원가입이 가능합니다.");
return new SuccessResponse(SIGNUP_AVAILABLE, email);
}

public SuccessResponse<String> checkduplicateNickname(PostCheckDuplicateNicknameReq postCheckDuplicateNicknameReq) throws UserException {
String nickname = postCheckDuplicateNicknameReq.getNickname();
if (!userRepository.findByNickname(nickname.trim()).isEmpty()) {
throw new UserException(EXIST_NICKNAME);
}
return new SuccessResponse(SUCCESS, "회원가입이 가능합니다.");
return new SuccessResponse(SIGNUP_AVAILABLE, nickname);
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ public enum SuccessStatus {
* OK
*/
SUCCESS(200,"SUCCESS","요청이 완료 되었습니다."),
SIGNUP_AVAILABLE(200,"SUCCESS","회원가입이 가능합니다"),

/**
* Success Code : 201
Expand Down

0 comments on commit cacd0ea

Please sign in to comment.