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.
 
 
 
 
 

21 lines
550 B

defmodule MirageWeb.LinkLive.Show do
use MirageWeb, :live_view
alias Mirage.Links
@impl true
def mount(_params, %{"user_id" => user_id}, socket) do
{:ok, socket |> assign(:current_user, Mirage.Accounts.get_user!(user_id))}
end
@impl true
def handle_params(%{"id" => id}, _, socket) do
{:noreply,
socket
|> assign(:page_title, page_title(socket.assigns.live_action))
|> assign(:link, Links.get_link!(id))}
end
defp page_title(:show), do: "Show Note link"
defp page_title(:edit), do: "Edit Note link"
end