Skip to content

Commit

Permalink
fix: 계정 삭제 시 여행 존재 여부에 따른 분기문 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
LJW25 committed Mar 16, 2024
1 parent 4f545a7 commit bd33408
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions backend/src/main/java/hanglog/login/service/LoginService.java
Original file line number Diff line number Diff line change
Expand Up @@ -98,9 +98,13 @@ public void removeRefreshToken(final String refreshToken) {

public void deleteAccount(final Long memberId) {
final List<Long> tripIds = customTripRepository.findTripIdsByMemberId(memberId);
publishedTripRepository.deleteByTripIds(tripIds);
sharedTripRepository.deleteByTripIds(tripIds);

if (!tripIds.isEmpty()) {
publishedTripRepository.deleteByTripIds(tripIds);
sharedTripRepository.deleteByTripIds(tripIds);
publisher.publishEvent(new MemberDeleteEvent(tripIds, memberId));
}

memberRepository.deleteByMemberId(memberId);
publisher.publishEvent(new MemberDeleteEvent(tripIds, memberId));
}
}

0 comments on commit bd33408

Please sign in to comment.