Skip to content

Commit

Permalink
fix: 회원 탈퇴시 발자국 외래키 제약조건으로 인해 탈퇴하지 못하는 현상 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
J-I-H-O committed Aug 23, 2024
1 parent 6c37ec9 commit fd4d238
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,6 @@ default Footprint getById(Long id) {
return findById(id)
.orElseThrow(() -> new FriendoglyException("발자국이 존재하지 않습니다."));
}

void deleteAllByMemberId(Long memberId);
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
import com.happy.friendogly.auth.service.jwt.TokenPayload;
import com.happy.friendogly.club.repository.ClubRepository;
import com.happy.friendogly.club.service.ClubCommandService;
import com.happy.friendogly.footprint.domain.Footprint;
import com.happy.friendogly.footprint.repository.FootprintRepository;
import com.happy.friendogly.infra.FileStorageManager;
import com.happy.friendogly.infra.ImageUpdateType;
Expand Down Expand Up @@ -103,9 +102,8 @@ public void delete(Long memberId) {
.forEach(club -> clubCommandService.deleteClubMember(club.getId(), memberId));

// 해당 회원의 발자국 삭제
footprintRepository.findTopOneByMemberIdOrderByCreatedAtDesc(memberId)
.ifPresent(Footprint::updateToDeleted);

footprintRepository.deleteAllByMemberId(memberId);

// 해당 회원의 반려견 삭제
// TODO: 해당 반려견 이미지 S3에서 삭제
petRepository.deleteAllByMemberId(memberId);
Expand Down

0 comments on commit fd4d238

Please sign in to comment.