From 7b9a4af3112dc4edcd378dc94190e2eb8e041f56 Mon Sep 17 00:00:00 2001 From: Eugen Rochko Date: Mon, 3 Oct 2016 18:17:06 +0200 Subject: API for blocking and unblocking --- app/controllers/api/v1/accounts_controller.rb | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'app/controllers') 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 -- cgit