Log admin approve and reject account (#22088)
* Log admin approve and reject account * Add unit tests for approve and reject logging
This commit is contained in:
parent
c8849d6cee
commit
f6492a7c4d
4 changed files with 103 additions and 0 deletions
|
@ -54,12 +54,14 @@ class Api::V1::Admin::AccountsController < Api::BaseController
|
|||
def approve
|
||||
authorize @account.user, :approve?
|
||||
@account.user.approve!
|
||||
log_action :approve, @account.user
|
||||
render json: @account, serializer: REST::Admin::AccountSerializer
|
||||
end
|
||||
|
||||
def reject
|
||||
authorize @account.user, :reject?
|
||||
DeleteAccountService.new.call(@account, reserve_email: false, reserve_username: false)
|
||||
log_action :reject, @account.user
|
||||
render_empty
|
||||
end
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue