Skip to content

Commit

Permalink
Merge pull request #196 from Team-Smeme/sohyeon_#194
Browse files Browse the repository at this point in the history
[FIX] 회원이 임시 삭제한 일기 데이터 삭제
  • Loading branch information
thguss authored Jan 28, 2024
2 parents cd6e247 + 5386cdb commit 6e6ff7d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -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<DeletedDiary, Long> {
void deleteByUpdatedAtBefore(LocalDateTime expiredAt);
void deleteByMember(Member member);
}
1 change: 1 addition & 0 deletions src/main/java/com/smeme/server/service/DiaryService.java
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ private LocalDateTime getExpiryDate() {
@Transactional
public void deleteAllByMember(Member member) {
diaryRepository.deleteAllByMember(member);
deletedDiaryRepository.deleteByMember(member);
}

public List<Diary> getAllByMemberId(Long memberId) {
Expand Down

0 comments on commit 6e6ff7d

Please sign in to comment.