add containers show page
This commit is contained in:
@ -14,10 +14,20 @@ defmodule CanneryWeb.ContainerLive.Show do
|
||||
|
||||
@impl true
|
||||
def handle_params(%{"id" => id}, _, socket) do
|
||||
{:noreply,
|
||||
socket
|
||||
|> assign(:page_title, page_title(socket.assigns.live_action))
|
||||
|> assign(:container, Containers.get_container!(id))}
|
||||
socket =
|
||||
socket
|
||||
|> assign(
|
||||
page_title: page_title(socket.assigns.live_action),
|
||||
container: Containers.get_container!(id)
|
||||
)
|
||||
|
||||
{:noreply, socket}
|
||||
end
|
||||
|
||||
@impl true
|
||||
def handle_event("delete", _, socket) do
|
||||
socket.assigns.container |> Containers.delete_container!()
|
||||
{:noreply, socket |> push_redirect(to: Routes.container_index_path(socket, :index))}
|
||||
end
|
||||
|
||||
defp page_title(:show), do: "Show Container"
|
||||
|
Reference in New Issue
Block a user