diff options
author | Thibaut Girka <thib@sitedethib.com> | 2018-12-17 20:25:47 +0100 |
---|---|---|
committer | ThibG <thib@sitedethib.com> | 2018-12-20 14:51:12 +0100 |
commit | 0cd367e2954fd5407461a3c01e9fbfb297575145 (patch) | |
tree | e7ca953930dc6a284454b3ef99bc5695b0cd199c /app/controllers | |
parent | c2b1e8bc433dfbb61e6e4ef9e6cb4a8b907c198f (diff) |
Refactor followers_accounts_controller
Diffstat (limited to 'app/controllers')
-rw-r--r-- | app/controllers/follower_accounts_controller.rb | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/app/controllers/follower_accounts_controller.rb b/app/controllers/follower_accounts_controller.rb index f5670c6bf..461e6d70e 100644 --- a/app/controllers/follower_accounts_controller.rb +++ b/app/controllers/follower_accounts_controller.rb @@ -36,22 +36,22 @@ class FollowerAccountsController < ApplicationController end def collection_presenter + options = { type: :ordered } + options[:size] = @account.followers_count if params[:page].present? ActivityPub::CollectionPresenter.new( id: account_followers_url(@account, page: params.fetch(:page, 1)), - type: :ordered, - size: @account.followers_count, items: follows.map { |f| ActivityPub::TagManager.instance.uri_for(f.account) }, part_of: account_followers_url(@account), next: page_url(follows.next_page), - prev: page_url(follows.prev_page) + prev: page_url(follows.prev_page), + **options ) else ActivityPub::CollectionPresenter.new( id: account_followers_url(@account), - type: :ordered, - size: @account.followers_count, - first: page_url(1) + first: page_url(1), + **options ) end end |