FEATURE: Add an option to block IPs and emails to bulk user delete (#29993)

This commit adds an option for blocking the IP and email addresses when bulk-deleting users.

Internal topic: t/140321/11.
This commit is contained in:
Osama Sayegh
2024-12-09 14:25:31 +03:00
committed by GitHub
parent 976aca68f6
commit acc180611f
7 changed files with 140 additions and 9 deletions

View File

@ -403,8 +403,12 @@ class Admin::UsersController < Admin::StaffController
end
def destroy_bulk
# capture service_params outside the hijack block to avoid thread safety
# issues
service_arg = service_params
hijack do
User::BulkDestroy.call(service_params) do
User::BulkDestroy.call(service_arg) do
on_success { render json: { deleted: true } }
on_failed_contract do |contract|