Fix changed filter params in admin APIs
Fix approve and reject actions not being logged from individual actions
This commit is contained in:
parent
d78ddb1cea
commit
5b5cc4b3fa
58 changed files with 83 additions and 91 deletions
|
@ -48,12 +48,14 @@ module Admin
|
|||
|
||||
def approve
|
||||
authorize @account.user, :approve?
|
||||
log_action :approve, @account.user
|
||||
@account.user.approve!
|
||||
redirect_to admin_accounts_path(status: 'pending'), notice: I18n.t('admin.accounts.approved_msg', username: @account.acct)
|
||||
end
|
||||
|
||||
def reject
|
||||
authorize @account.user, :reject?
|
||||
log_action :reject, @account.user, username: @account.username
|
||||
DeleteAccountService.new.call(@account, reserve_email: false, reserve_username: false)
|
||||
redirect_to admin_accounts_path(status: 'pending'), notice: I18n.t('admin.accounts.rejected_msg', username: @account.acct)
|
||||
end
|
||||
|
|
|
@ -48,7 +48,7 @@ module Admin
|
|||
private
|
||||
|
||||
def filtered_reports
|
||||
ReportFilter.new(filter_params).results.order(id: :desc).includes(:account, :target_account)
|
||||
ReportFilter.new(filter_params).results.includes(:account, :target_account)
|
||||
end
|
||||
|
||||
def filter_params
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue