diff options
author | Egor Kislitsyn <egor@kislitsyn.com> | 2020-04-08 23:16:20 +0400 |
---|---|---|
committer | Egor Kislitsyn <egor@kislitsyn.com> | 2020-04-13 18:17:07 +0400 |
commit | bd6e2b300f82e66afb121c2339c3cbbfb0b1a446 (patch) | |
tree | 001c4b4b1e039ee0f644a47d14820008a49e0bd8 /lib/pleroma/web/mastodon_api/controllers/account_controller.ex | |
parent | 03124c96cc192ef8c4893738a0cee552c6984da6 (diff) | |
download | pleroma-bd6e2b300f82e66afb121c2339c3cbbfb0b1a446.tar.gz |
Add spec for AccountController.followers
Diffstat (limited to 'lib/pleroma/web/mastodon_api/controllers/account_controller.ex')
-rw-r--r-- | lib/pleroma/web/mastodon_api/controllers/account_controller.ex | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/pleroma/web/mastodon_api/controllers/account_controller.ex b/lib/pleroma/web/mastodon_api/controllers/account_controller.ex index 208df5698..1ffccdd1d 100644 --- a/lib/pleroma/web/mastodon_api/controllers/account_controller.ex +++ b/lib/pleroma/web/mastodon_api/controllers/account_controller.ex @@ -89,7 +89,8 @@ defmodule Pleroma.Web.MastodonAPI.AccountController do :update_credentials, :relationships, :show, - :statuses + :statuses, + :followers ] ) @@ -284,6 +285,11 @@ defmodule Pleroma.Web.MastodonAPI.AccountController do @doc "GET /api/v1/accounts/:id/followers" def followers(%{assigns: %{user: for_user, account: user}} = conn, params) do + params = + params + |> Enum.map(fn {key, value} -> {to_string(key), value} end) + |> Enum.into(%{}) + followers = cond do for_user && user.id == for_user.id -> MastodonAPI.get_followers(user, params) |