Add PleromaAPI.AccountController
This commit is contained in:
parent
e7aef27c00
commit
3c5ecb70b4
10 changed files with 579 additions and 566 deletions
|
|
@ -68,4 +68,11 @@ defmodule Pleroma.Web.ControllerHelper do
|
|||
conn
|
||||
end
|
||||
end
|
||||
|
||||
def assign_account_by_id(%{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
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue