Fix render/4 -> render/3 calls

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
Thomas Citharel 2019-03-01 12:57:39 +01:00
parent 5713670ac9
commit b3a3001e90
No known key found for this signature in database
GPG Key ID: A061B9DDE0CA0773

View File

@ -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