My space on the web https://inhji.de
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

24 lines
542 B

defmodule MirageWeb.ListLive.Show do
@moduledoc """
Shows lists and their edit form
"""
use MirageWeb, :live_view
alias Mirage.Lists
@impl true
def mount(_params, session, socket) do
{:ok, socket |> with_user(session)}
end
@impl true
def handle_params(%{"id" => id}, _, socket) do
{:noreply,
socket
|> assign(:page_title, page_title(socket.assigns.live_action))
|> assign(:list, Lists.get_list!(id))}
end
defp page_title(:show), do: "Show List"
defp page_title(:edit), do: "Edit List"
end