added refresh token

This commit is contained in:
SlimusMinus
2026-08-03 02:43:46 +03:00
parent d3a231f3fc
commit 7660128d96
21 changed files with 309 additions and 138 deletions

View File

@@ -12,7 +12,6 @@ public interface FavoriteRepository extends JpaRepository<Favorite, Long> {
boolean existsByUserAndPost(User user, Post post);
List<Favorite> findByUser(User user);
void deleteByUserAndPost(User user, Post post);
void deleteByPost(Post post);
void deleteByPostIn(List<Post> posts);
@Query("""
@@ -24,10 +23,10 @@ public interface FavoriteRepository extends JpaRepository<Favorite, Long> {
// ADD THIS METHOD:
@Query("""
SELECT f.post.id, COUNT(f.id)
FROM Favorite f
WHERE f.post.id IN :postIds
SELECT f.post.id, COUNT(f.id)\s
FROM Favorite f\s
WHERE f.post.id IN :postIds\s
GROUP BY f.post.id
""")
\s""")
List<Object[]> countLikesByPostIds(List<Long> postIds);
}