about summary refs log tree commit diff
path: root/app/controllers/api/v1/domain_blocks_controller.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/controllers/api/v1/domain_blocks_controller.rb')
-rw-r--r--app/controllers/api/v1/domain_blocks_controller.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/app/controllers/api/v1/domain_blocks_controller.rb b/app/controllers/api/v1/domain_blocks_controller.rb
index ae6ad7936..e55d622c3 100644
--- a/app/controllers/api/v1/domain_blocks_controller.rb
+++ b/app/controllers/api/v1/domain_blocks_controller.rb
@@ -15,7 +15,8 @@ class Api::V1::DomainBlocksController < Api::BaseController
   end
 
   def create
-    BlockDomainFromAccountService.new.call(current_account, domain_block_params[:domain])
+    current_account.block_domain!(domain_block_params[:domain])
+    AfterAccountDomainBlockWorker.perform_async(current_account.id, domain_block_params[:domain])
     render_empty
   end