Skip to content

Commit

Permalink
!hotfix: diary repository flush
Browse files Browse the repository at this point in the history
  • Loading branch information
daeun084 committed Dec 16, 2024
1 parent 579b132 commit 5a32125
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ public List<DiarySimpleResponse> getComplimentCardDiaries(Long complimentId) {
return diaryRepository.findDiaryByComplimentCard(complimentCard, userId);
}

@Transactional
public void deleteComplimentCard(Long userId) {
Long complimentId = complimentCardRepository.findByDiaryAndUserId(userId);
complimentCardRepository.deleteById(complimentId);
Expand Down
1 change: 1 addition & 0 deletions src/main/java/LearnMate/dev/service/DiaryService.java
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,7 @@ public void deleteDiary(Long diaryId) {
validIsUserAuthorizedForDiary(userId, diary);

diaryRepository.delete(diary);
diaryRepository.flush();
complimentCardService.deleteComplimentCard(userId);
}

Expand Down

0 comments on commit 5a32125

Please sign in to comment.