aboutsummaryrefslogtreecommitdiff
path: root/lib/pleroma/web/mastodon_api/controllers/account_controller.ex
diff options
context:
space:
mode:
authorEgor Kislitsyn <egor@kislitsyn.com>2020-04-07 18:53:12 +0400
committerEgor Kislitsyn <egor@kislitsyn.com>2020-04-13 18:16:07 +0400
commit278b3fa0ad0ca58a9e5549e98d24944bbe0bf766 (patch)
tree7a2605c85259b0c554c8f49a2b6b1387dd309ea4 /lib/pleroma/web/mastodon_api/controllers/account_controller.ex
parentd7d6a83233f24b80005b4f49a8697535620e4b83 (diff)
downloadpleroma-278b3fa0ad0ca58a9e5549e98d24944bbe0bf766.tar.gz
Add spec for AccountController.show
Diffstat (limited to 'lib/pleroma/web/mastodon_api/controllers/account_controller.ex')
-rw-r--r--lib/pleroma/web/mastodon_api/controllers/account_controller.ex4
1 files changed, 2 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 1652e3a1b..67375f31c 100644
--- a/lib/pleroma/web/mastodon_api/controllers/account_controller.ex
+++ b/lib/pleroma/web/mastodon_api/controllers/account_controller.ex
@@ -83,7 +83,7 @@ defmodule Pleroma.Web.MastodonAPI.AccountController do
plug(
OpenApiSpex.Plug.CastAndValidate,
[render_error: Pleroma.Web.ApiSpec.RenderError]
- when action in [:create, :verify_credentials, :update_credentials, :relationships]
+ when action in [:create, :verify_credentials, :update_credentials, :relationships, :show]
)
action_fallback(Pleroma.Web.MastodonAPI.FallbackController)
@@ -239,7 +239,7 @@ defmodule Pleroma.Web.MastodonAPI.AccountController do
def relationships(%{assigns: %{user: _user}} = conn, _), do: json(conn, [])
@doc "GET /api/v1/accounts/:id"
- def show(%{assigns: %{user: for_user}} = conn, %{"id" => nickname_or_id}) do
+ def show(%{assigns: %{user: for_user}} = conn, %{id: nickname_or_id}) do
with %User{} = user <- User.get_cached_by_nickname_or_id(nickname_or_id, for: for_user),
true <- User.visible_for?(user, for_user) do
render(conn, "show.json", user: user, for: for_user)