deleted likes

This commit is contained in:
SlimusMinus
2026-09-24 00:18:13 +03:00
parent ca06c2a5c3
commit 0afb2397cf
4 changed files with 11 additions and 102 deletions

View File

@@ -10,7 +10,6 @@ import com.krylov.refound.mapper.PostMapper;
import com.krylov.refound.repository.FavoriteRepository;
import com.krylov.refound.repository.PostRepository;
import java.util.List;
import java.util.Map;
import java.util.Set;
import lombok.RequiredArgsConstructor;
import org.springframework.http.HttpStatus;
@@ -75,11 +74,9 @@ public class FavoriteService {
.map(Post::getId)
.toList();
Map<Long, Long> likeCounts = postService.countLikes(postIds);
Set<Long> userFavoriteIds = postService.currentUserFavoriteIds(postIds); // тут будет == postIds, но ок для единообразия
return posts.stream()
.map(post -> postService.toResponse(post, likeCounts, userFavoriteIds, true))
.map(post -> postService.toResponse(post, true))
.toList();
}
}