Only include at most 30 likes and reshares on pageload in the SPV

This commit is contained in:
Steffen van Bergerem 2017-02-17 22:33:29 +01:00
parent 6b162110ce
commit 5808b84e83
No known key found for this signature in database
GPG key ID: 315C9787D548DC6B

View file

@ -22,8 +22,8 @@ class PostPresenter < BasePresenter
def with_initial_interactions
as_json.tap do |post|
post[:interactions].merge!(
likes: LikeService.new(current_user).find_for_post(@post.id).as_api_response(:backbone),
reshares: ReshareService.new(current_user).find_for_post(@post.id).as_api_response(:backbone)
likes: LikeService.new(current_user).find_for_post(@post.id).limit(30).as_api_response(:backbone),
reshares: ReshareService.new(current_user).find_for_post(@post.id).limit(30).as_api_response(:backbone)
)
end
end