Skip to content

Commit

Permalink
๐Ÿ”ง ์ตœ์ดˆ ๊ฐ€์ž…์‹œ ์˜ค๋ฅ˜๋‚˜๋Š” ๋ฌธ์ œ ํ•ด๊ฒฐ
Browse files Browse the repository at this point in the history
  • Loading branch information
youngreal committed Nov 20, 2024
1 parent a426c41 commit 4e31823
Showing 1 changed file with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,6 @@ public Member saveMember(String email, String sub, String selectedColor) {
log.info("sub = {}", sub);
validateNewMemberEmail(email, sub);
String targetEmail = determineEmail(email, sub);
if (targetEmail.equals(email)) {
withDrawMemberRepository.save(WithdrawMember.of(sub, email));
}
return memberRepository.save(
Member.of(
memberNameGenerator.generateRandomName(),
Expand Down Expand Up @@ -92,7 +89,14 @@ private String determineEmail(String email, String sub) {

// ์ผ€์ด์Šค 2, 4: ์ด๋ฉ”์ผ์ด ์žˆ๋Š” ๊ฒฝ์šฐ
WithdrawMember withdrawMember = withDrawMemberRepository.findByEmail(email);
return withdrawMember.getEmail() == null ? email : withdrawMember.getEmail();

//์ตœ์ดˆ ๊ฐ€์ž…์ธ๊ฒฝ์šฐ
if (withdrawMember == null) {
WithdrawMember withdrawMember1 = withDrawMemberRepository.save(WithdrawMember.of(sub, email));
return withdrawMember1.getEmail();
}
// ํƒˆํ‡ดํ›„
return withdrawMember.getEmail();
}

private void validateNewMemberEmail(String email, String sub) {
Expand Down

0 comments on commit 4e31823

Please sign in to comment.