about summary refs log tree commit diff
path: root/app/controllers/api/v1/admin
diff options
context:
space:
mode:
authorStarfall <us@starfall.systems>2020-10-08 20:34:20 -0500
committerStarfall <us@starfall.systems>2020-10-08 20:34:20 -0500
commit220958fc9fff236e61560f20079be28dea7e23fc (patch)
tree6a0f4588fc367462e82d5304b1eab9cf5c890445 /app/controllers/api/v1/admin
parent4966c6cc24107c728fe8e0de7ffc4d0a8cc5510d (diff)
parentcd861c051ce5500df49d2fc41b2a6084faa34620 (diff)
Merge branch 'glitch' into main
Diffstat (limited to 'app/controllers/api/v1/admin')
-rw-r--r--app/controllers/api/v1/admin/accounts_controller.rb9
1 files changed, 8 insertions, 1 deletions
diff --git a/app/controllers/api/v1/admin/accounts_controller.rb b/app/controllers/api/v1/admin/accounts_controller.rb
index 24c7fbef1..3af572f25 100644
--- a/app/controllers/api/v1/admin/accounts_controller.rb
+++ b/app/controllers/api/v1/admin/accounts_controller.rb
@@ -58,7 +58,13 @@ class Api::V1::Admin::AccountsController < Api::BaseController
 
   def reject
     authorize @account.user, :reject?
-    SuspendAccountService.new.call(@account, reserve_email: false, reserve_username: false)
+    DeleteAccountService.new.call(@account, reserve_email: false, reserve_username: false)
+    render json: @account, serializer: REST::Admin::AccountSerializer
+  end
+
+  def destroy
+    authorize @account, :destroy?
+    Admin::AccountDeletionWorker.perform_async(@account.id)
     render json: @account, serializer: REST::Admin::AccountSerializer
   end
 
@@ -72,6 +78,7 @@ class Api::V1::Admin::AccountsController < Api::BaseController
   def unsuspend
     authorize @account, :unsuspend?
     @account.unsuspend!
+    Admin::UnsuspensionWorker.perform_async(@account.id)
     log_action :unsuspend, @account
     render json: @account, serializer: REST::Admin::AccountSerializer
   end