diff options
author | Ivan Tashkinov <ivantashkinov@gmail.com> | 2019-11-20 15:46:11 +0300 |
---|---|---|
committer | Ivan Tashkinov <ivantashkinov@gmail.com> | 2019-11-20 15:46:11 +0300 |
commit | de892d2fe1e70054aaf946b4cd11fb39111fe937 (patch) | |
tree | 6e68d638890ef9d6e731f6b3a180c2ae611de61e /lib/pleroma/web/pleroma_api | |
parent | 555edd01abf62b74c14c30caf82d77a80a93e72c (diff) | |
download | pleroma-de892d2fe1e70054aaf946b4cd11fb39111fe937.tar.gz |
[#1335] Reorganized users.subscribers as UserRelationship. Added tests for UserRelationship-related functionality.
Diffstat (limited to 'lib/pleroma/web/pleroma_api')
-rw-r--r-- | lib/pleroma/web/pleroma_api/controllers/account_controller.ex | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/pleroma/web/pleroma_api/controllers/account_controller.ex b/lib/pleroma/web/pleroma_api/controllers/account_controller.ex index bc2f1017c..773cd9a97 100644 --- a/lib/pleroma/web/pleroma_api/controllers/account_controller.ex +++ b/lib/pleroma/web/pleroma_api/controllers/account_controller.ex @@ -144,7 +144,7 @@ defmodule Pleroma.Web.PleromaAPI.AccountController do @doc "POST /api/v1/pleroma/accounts/:id/subscribe" def subscribe(%{assigns: %{user: user, account: subscription_target}} = conn, _params) do - with {:ok, subscription_target} <- User.subscribe(user, subscription_target) do + with {:ok, _subscription} <- User.subscribe(user, subscription_target) do render(conn, "relationship.json", user: user, target: subscription_target) else {:error, message} -> json_response(conn, :forbidden, %{error: message}) @@ -153,7 +153,7 @@ defmodule Pleroma.Web.PleromaAPI.AccountController do @doc "POST /api/v1/pleroma/accounts/:id/unsubscribe" def unsubscribe(%{assigns: %{user: user, account: subscription_target}} = conn, _params) do - with {:ok, subscription_target} <- User.unsubscribe(user, subscription_target) do + with {:ok, _subscription} <- User.unsubscribe(user, subscription_target) do render(conn, "relationship.json", user: user, target: subscription_target) else {:error, message} -> json_response(conn, :forbidden, %{error: message}) |