diff --git a/src/main/java/com/smeme/server/repository/diary/DeletedDiaryRepository.java b/src/main/java/com/smeme/server/repository/diary/DeletedDiaryRepository.java index 0d83c298..e8d67c55 100644 --- a/src/main/java/com/smeme/server/repository/diary/DeletedDiaryRepository.java +++ b/src/main/java/com/smeme/server/repository/diary/DeletedDiaryRepository.java @@ -1,10 +1,12 @@ package com.smeme.server.repository.diary; import com.smeme.server.model.DeletedDiary; +import com.smeme.server.model.Member; import org.springframework.data.jpa.repository.JpaRepository; import java.time.LocalDateTime; public interface DeletedDiaryRepository extends JpaRepository { void deleteByUpdatedAtBefore(LocalDateTime expiredAt); + void deleteByMember(Member member); } diff --git a/src/main/java/com/smeme/server/service/DiaryService.java b/src/main/java/com/smeme/server/service/DiaryService.java index 5f95fed3..16bf3f2c 100644 --- a/src/main/java/com/smeme/server/service/DiaryService.java +++ b/src/main/java/com/smeme/server/service/DiaryService.java @@ -112,6 +112,7 @@ private LocalDateTime getExpiryDate() { @Transactional public void deleteAllByMember(Member member) { diaryRepository.deleteAllByMember(member); + deletedDiaryRepository.deleteByMember(member); } public List getAllByMemberId(Long memberId) {