fix post deletion cascade

This commit is contained in:
Tim
2025-07-14 17:34:15 +08:00
parent 1974b60bdd
commit e0e1dea166
4 changed files with 59 additions and 0 deletions

View File

@@ -360,6 +360,7 @@ public class PostService {
reactionRepository.findByPost(post).forEach(reactionRepository::delete);
postSubscriptionRepository.findByPost(post).forEach(postSubscriptionRepository::delete);
notificationRepository.deleteAll(notificationRepository.findByPost(post));
postReadService.deleteByPost(post);
postRepository.delete(post);
}