Skip to content

Commit

Permalink
Add method to show a supply
Browse files Browse the repository at this point in the history
  • Loading branch information
erickmp07 committed Oct 21, 2021
1 parent 6121bfe commit 90e23a2
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions lib/inmana_web/controllers/supplies_controller.ex
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,12 @@ defmodule InmanaWeb.SuppliesController do
|> render("create.json", supply: supply)
end
end

def show(connection, %{"id" => uuid}) do
with {:ok, %Supply{} = supply} <- Inmana.get_supply(uuid) do
connection
|> put_status(:ok)
|> render("show.json", supply: supply)
end
end
end

0 comments on commit 90e23a2

Please sign in to comment.