Fix timeline emoji_reactions N+1 problem

This commit is contained in:
KMY 2023-09-15 09:31:12 +09:00
parent 7c387becb6
commit c0ff0754a3
12 changed files with 84 additions and 16 deletions

View file

@ -7,7 +7,9 @@ class Api::V1::Timelines::PublicController < Api::BaseController
def show
cache_if_unauthenticated!
@statuses = load_statuses
render json: @statuses, each_serializer: REST::StatusSerializer, relationships: StatusRelationshipsPresenter.new(@statuses, current_user&.account_id)
render json: @statuses, each_serializer: REST::StatusSerializer,
relationships: StatusRelationshipsPresenter.new(@statuses, current_user&.account_id),
emoji_reaction_permitted_account_ids: EmojiReactionAccountsPresenter.new(@statuses, current_user&.account_id)
end
private