Fix admin APIs returning deleted object instead of empty object upon delete (#19479)
Fix #19153
This commit is contained in:
parent
5724da0780
commit
276b85bc91
6 changed files with 7 additions and 21 deletions
|
@ -60,14 +60,13 @@ class Api::V1::Admin::AccountsController < Api::BaseController
|
|||
def reject
|
||||
authorize @account.user, :reject?
|
||||
DeleteAccountService.new.call(@account, reserve_email: false, reserve_username: false)
|
||||
render json: @account, serializer: REST::Admin::AccountSerializer
|
||||
render_empty
|
||||
end
|
||||
|
||||
def destroy
|
||||
authorize @account, :destroy?
|
||||
json = render_to_body json: @account, serializer: REST::Admin::AccountSerializer
|
||||
Admin::AccountDeletionWorker.perform_async(@account.id)
|
||||
render json: json
|
||||
render_empty
|
||||
end
|
||||
|
||||
def unsensitive
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue