deleted likes
This commit is contained in:
@@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user