about summary refs log tree commit diff
path: root/app/controllers/admin/accounts_controller.rb
blob: 4c41c42159cff9569a643ea14e4b730ed7e8ea70 (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
31
32
33
34
# 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,
        :username,
        :display_name,
        :email,
        :ip
      )
    end
  end
end