Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BE] fix: 회원 탈퇴시 발자국 외래키 제약조건으로 인해 탈퇴하지 못하는 현상 수정 #531

Merged
merged 1 commit into from
Sep 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading