Fix changed filter params in admin APIs

Fix approve and reject actions not being logged from individual actions
This commit is contained in:
Eugen Rochko 2021-12-26 00:39:05 +01:00
parent d78ddb1cea
commit 5b5cc4b3fa
58 changed files with 83 additions and 91 deletions

View file

@ -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

View file

@ -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