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

@@ -10,4 +10,5 @@ import java.util.Optional;
public interface PostReadRepository extends JpaRepository<PostRead, Long> {
Optional<PostRead> findByUserAndPost(User user, Post post);
long countByUser(User user);
void deleteByPost(Post post);
}