Add spec for AccountController.follows
[akkoma] / lib / pleroma / web / mastodon_api / controllers / account_controller.ex
index 9aba2e094f6237406b909d1d79d4525762a4c6b3..4340b9c8426e59bfd71416efed072240915a30e4 100644 (file)
@@ -96,7 +96,10 @@ defmodule Pleroma.Web.MastodonAPI.AccountController do
            :follow,
            :unfollow,
            :mute,
-           :unmute
+           :unmute,
+           :block,
+           :unblock,
+           :follows
          ]
   )
 
@@ -399,7 +402,7 @@ defmodule Pleroma.Web.MastodonAPI.AccountController do
   end
 
   @doc "POST /api/v1/follows"
-  def follows(%{assigns: %{user: follower}} = conn, %{"uri" => uri}) do
+  def follows(%{assigns: %{user: follower}, body_params: %{uri: uri}} = conn, _) do
     with {_, %User{} = followed} <- {:followed, User.get_cached_by_nickname(uri)},
          {_, true} <- {:followed, follower.id != followed.id},
          {:ok, follower, followed, _} <- CommonAPI.follow(follower, followed) do