Use atoms as keys in ActivityPub.fetch_* functions options

This commit is contained in:
Egor Kislitsyn 2020-06-04 21:33:16 +04:00
commit 317e2b8d61
No known key found for this signature in database
GPG key ID: 1B49CB15B71E7805
27 changed files with 538 additions and 636 deletions

View file

@ -81,8 +81,7 @@ defmodule Pleroma.Web.ControllerHelper do
end
def assign_account_by_id(conn, _) do
# TODO: use `conn.params[:id]` only after moving to OpenAPI
case Pleroma.User.get_cached_by_id(conn.params[:id] || conn.params["id"]) do
case Pleroma.User.get_cached_by_id(conn.params.id) do
%Pleroma.User{} = account -> assign(conn, :account, account)
nil -> Pleroma.Web.MastodonAPI.FallbackController.call(conn, {:error, :not_found}) |> halt()
end