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