diff options
author | Guillermo Ramos | 2020-02-04 17:06:22 +0100 |
---|---|---|
committer | Guillermo Ramos | 2020-02-04 17:18:12 +0100 |
commit | ffc0bb5dab06874f2737a3def62835e45e0cd676 (patch) | |
tree | f20c2b34d3096a20909e501584d202fa7a223d42 /lib/waev_web/controllers | |
parent | 4c399821684fa38b0d52b03932d7856b569478ab (diff) | |
download | waev-ffc0bb5dab06874f2737a3def62835e45e0cd676.tar.gz |
Parse exports
Diffstat (limited to 'lib/waev_web/controllers')
-rw-r--r-- | lib/waev_web/controllers/exports_controller.ex | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/lib/waev_web/controllers/exports_controller.ex b/lib/waev_web/controllers/exports_controller.ex index a50896e..a3dde48 100644 --- a/lib/waev_web/controllers/exports_controller.ex +++ b/lib/waev_web/controllers/exports_controller.ex @@ -2,6 +2,15 @@ defmodule WaevWeb.ExportsController do use WaevWeb, :controller def show(conn, %{"id" => id}) do - render(conn, "show.html", id: id) + case Waev.Export.get(id) do + {:ok, export} -> + render(conn, "show.html", id: id, export: export) + + :error -> + conn + |> put_status(:not_found) + |> put_view(WaevWeb.ErrorView) + |> render("404.html") + end end end |