about summary refs log tree commit diff
path: root/app/controllers/admin/accounts_controller.rb
blob: 0e9e52f42a1e8a88d52b3db710a50cc2fdbf8547 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# frozen_string_literal: true

module Admin
  class AccountsController < BaseController
    def index
      @accounts = filtered_accounts.page(params[:page])
    end

    def show
      @account = Account.find(params[:id])
    end

    private

    def filtered_accounts
      AccountFilter.new(filter_params).results
    end

    def filter_params
      params.permit(
        :local,
        :remote,
        :by_domain,
        :silenced,
        :recent,
        :suspended
      )
    end
  end
end