Fix render/4 -> render/3 calls
Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
parent
5713670ac9
commit
b3a3001e90
|
@ -9,18 +9,21 @@ defmodule MobilizonWeb.FallbackController do
|
||||||
def call(conn, {:error, %Ecto.Changeset{} = changeset}) do
|
def call(conn, {:error, %Ecto.Changeset{} = changeset}) do
|
||||||
conn
|
conn
|
||||||
|> put_status(:unprocessable_entity)
|
|> put_status(:unprocessable_entity)
|
||||||
|> render(MobilizonWeb.ChangesetView, "error.json", changeset: changeset)
|
|> put_view(MobilizonWeb.ChangesetView)
|
||||||
|
|> render("error.json", changeset: changeset)
|
||||||
end
|
end
|
||||||
|
|
||||||
def call(conn, {:error, nil}) do
|
def call(conn, {:error, nil}) do
|
||||||
conn
|
conn
|
||||||
|> put_status(:unprocessable_entity)
|
|> put_status(:unprocessable_entity)
|
||||||
|> render(MobilizonWeb.ErrorView, "invalid_request.json")
|
|> put_view(MobilizonWeb.ErrorView)
|
||||||
|
|> render("invalid_request.json")
|
||||||
end
|
end
|
||||||
|
|
||||||
def call(conn, {:error, :not_found}) do
|
def call(conn, {:error, :not_found}) do
|
||||||
conn
|
conn
|
||||||
|> put_status(:not_found)
|
|> put_status(:not_found)
|
||||||
|> render(MobilizonWeb.ErrorView, :"404")
|
|> put_view(MobilizonWeb.ErrorView)
|
||||||
|
|> render(:"404")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue