Pleroma.Web.MastodonAPI.AccountController: fix dialyzer errors with replace_params: false

This commit is contained in:
Mark Felder 2024-01-30 16:50:00 -05:00
commit 81c8592d69
2 changed files with 57 additions and 16 deletions

View file

@ -85,8 +85,8 @@ defmodule Pleroma.Web.ControllerHelper do
end
end
def assign_account_by_id(conn, _) do
case Pleroma.User.get_cached_by_id(conn.params.id) do
def assign_account_by_id(%{private: %{open_api_spex: %{params: %{id: id}}}} = conn, _) do
case Pleroma.User.get_cached_by_id(id) do
%Pleroma.User{} = account -> assign(conn, :account, account)
nil -> Pleroma.Web.MastodonAPI.FallbackController.call(conn, {:error, :not_found}) |> halt()
end