Extract poll actions from MastodonAPIController to PollController

This commit is contained in:
Egor Kislitsyn 2019-10-01 11:44:34 +07:00
commit 36a34c36fe
No known key found for this signature in database
GPG key ID: 1B49CB15B71E7805
11 changed files with 454 additions and 419 deletions

View file

@ -75,4 +75,16 @@ defmodule Pleroma.Web.ControllerHelper do
nil -> Pleroma.Web.MastodonAPI.FallbackController.call(conn, {:error, :not_found}) |> halt()
end
end
def try_render(conn, target, params)
when is_binary(target) do
case render(conn, target, params) do
nil -> render_error(conn, :not_implemented, "Can't display this activity")
res -> res
end
end
def try_render(conn, _, _) do
render_error(conn, :not_implemented, "Can't display this activity")
end
end