aboutsummaryrefslogtreecommitdiff
path: root/lib/pleroma/web/mastodon_api/controllers/account_controller.ex
diff options
context:
space:
mode:
Diffstat (limited to 'lib/pleroma/web/mastodon_api/controllers/account_controller.ex')
-rw-r--r--lib/pleroma/web/mastodon_api/controllers/account_controller.ex7
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/pleroma/web/mastodon_api/controllers/account_controller.ex b/lib/pleroma/web/mastodon_api/controllers/account_controller.ex
index 31d75ba85..50dd0e4c2 100644
--- a/lib/pleroma/web/mastodon_api/controllers/account_controller.ex
+++ b/lib/pleroma/web/mastodon_api/controllers/account_controller.ex
@@ -479,9 +479,12 @@ defmodule Pleroma.Web.MastodonAPI.AccountController do
{:error, "Can not unfollow yourself"}
end
- def remove_from_followers(%{assigns: %{user: follower, account: followed}} = conn, _params) do
- with {:ok, follower} <- CommonAPI.unfollow(followed, follower) do
+ def remove_from_followers(%{assigns: %{user: followed, account: follower}} = conn, _params) do
+ with {:ok, follower} <- CommonAPI.reject_follow_request(follower, followed) do
render(conn, "relationship.json", user: follower, target: followed)
+ else
+ nil ->
+ render_error(conn, :not_found, "Record not found")
end
end