about summary refs log tree commit diff
path: root/app/controllers/api/v1/accounts_controller.rb
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2016-10-03 18:17:06 +0200
committerEugen Rochko <eugen@zeonfederated.com>2016-10-03 18:17:06 +0200
commit7b9a4af3112dc4edcd378dc94190e2eb8e041f56 (patch)
tree8a817939f09f0b5fca6b46feb44b8ef6f9113e86 /app/controllers/api/v1/accounts_controller.rb
parent2c9e672ee2437677d6e39383e5f8e8e0837024b9 (diff)
API for blocking and unblocking
Diffstat (limited to 'app/controllers/api/v1/accounts_controller.rb')
-rw-r--r--app/controllers/api/v1/accounts_controller.rb16
1 files changed, 14 insertions, 2 deletions
diff --git a/app/controllers/api/v1/accounts_controller.rb b/app/controllers/api/v1/accounts_controller.rb
index 850d00d2e..930f60cc3 100644
--- a/app/controllers/api/v1/accounts_controller.rb
+++ b/app/controllers/api/v1/accounts_controller.rb
@@ -24,13 +24,25 @@ class Api::V1::AccountsController < ApiController
   end
 
   def follow
-    @follow = FollowService.new.call(current_user.account, @account.acct)
+    FollowService.new.call(current_user.account, @account.acct)
+    set_relationship
+    render action: :relationship
+  end
+
+  def block
+    BlockService.new.call(current_user.account, @account)
     set_relationship
     render action: :relationship
   end
 
   def unfollow
-    @unfollow = UnfollowService.new.call(current_user.account, @account)
+    UnfollowService.new.call(current_user.account, @account)
+    set_relationship
+    render action: :relationship
+  end
+
+  def unblock
+    UnblockService.new.call(current_user.account, @account)
     set_relationship
     render action: :relationship
   end