Skip to content

Commit

Permalink
feat: withdraw member
Browse files Browse the repository at this point in the history
  • Loading branch information
Seokyeong237 committed Feb 13, 2024
1 parent 597f798 commit 1a166cf
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@
@Repository
public interface MailRepository extends JpaRepository<Mail, MailId> {
Mail findByMemberId(MemberId memberId);
boolean existsByMemberId(MemberId memberId);
}
6 changes: 4 additions & 2 deletions src/main/java/com/fullcar/member/infra/MailClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,9 @@ public void checkMailAuthenticationCode(Member member, CodeRequestDto codeReques
@Transactional
@Override
public void deleteMail(MemberId memberId) {
Mail mail = mailRepository.findByMemberId(memberId);
mailRepository.delete(mail);
if (mailRepository.existsByMemberId(memberId)) {
Mail mail = mailRepository.findByMemberId(memberId);
mailRepository.delete(mail);
}
}
}

0 comments on commit 1a166cf

Please sign in to comment.