|
|
@ -32,14 +32,14 @@ class Api::V1::StatusesController < ApiController
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
def reblogged_by
|
|
|
|
def reblogged_by
|
|
|
|
@accounts = Account.includes(statuses: :reblogs)
|
|
|
|
@accounts = Account.includes(:statuses)
|
|
|
|
.references(statuses: :reblogs)
|
|
|
|
.references(:statuses)
|
|
|
|
.where(statuses: { id: @status.id })
|
|
|
|
.merge(Status.where(reblog_of_id: @status.id)
|
|
|
|
.merge(@status.reblogs.paginate_by_max_id(limit_param(DEFAULT_ACCOUNTS_LIMIT), params[:max_id], params[:since_id]))
|
|
|
|
.paginate_by_max_id(limit_param(DEFAULT_ACCOUNTS_LIMIT), params[:max_id], params[:since_id]))
|
|
|
|
.to_a
|
|
|
|
.to_a
|
|
|
|
|
|
|
|
|
|
|
|
next_path = reblogged_by_api_v1_status_url(pagination_params(max_id: @accounts.last.statuses.last.reblogs.last.id)) if @accounts.size == limit_param(DEFAULT_ACCOUNTS_LIMIT)
|
|
|
|
next_path = reblogged_by_api_v1_status_url(pagination_params(max_id: @accounts.last.statuses.last.id)) if @accounts.size == limit_param(DEFAULT_ACCOUNTS_LIMIT)
|
|
|
|
prev_path = reblogged_by_api_v1_status_url(pagination_params(since_id: @accounts.first.statuses.first.reblogs.first.id)) unless @accounts.empty?
|
|
|
|
prev_path = reblogged_by_api_v1_status_url(pagination_params(since_id: @accounts.first.statuses.first.id)) unless @accounts.empty?
|
|
|
|
|
|
|
|
|
|
|
|
set_pagination_headers(next_path, prev_path)
|
|
|
|
set_pagination_headers(next_path, prev_path)
|
|
|
|
|
|
|
|
|
|
|
|