From f6492a7c4d7cd08364ba507911f6b3c3df1c7e70 Mon Sep 17 00:00:00 2001 From: Francis Murillo Date: Tue, 6 Dec 2022 23:25:18 +0000 Subject: Log admin approve and reject account (#22088) * Log admin approve and reject account * Add unit tests for approve and reject logging --- app/controllers/api/v1/admin/accounts_controller.rb | 2 ++ 1 file changed, 2 insertions(+) (limited to 'app/controllers/api/v1') diff --git a/app/controllers/api/v1/admin/accounts_controller.rb b/app/controllers/api/v1/admin/accounts_controller.rb index ae7f7d076..f48300072 100644 --- a/app/controllers/api/v1/admin/accounts_controller.rb +++ b/app/controllers/api/v1/admin/accounts_controller.rb @@ -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 -- cgit