Update the Show LiveView to redirect to Edit Liveview for Author.

dev
KKlochko 5 months ago
parent d39cacf88d
commit cad5758ce9

@ -9,7 +9,7 @@ defmodule DecentralisedBookIndexWeb.AuthorLive.Show do
<:subtitle>This is a author record from your database.</:subtitle> <:subtitle>This is a author record from your database.</:subtitle>
<:actions> <:actions>
<.link patch={~p"/authors/#{@author}/show/edit"} phx-click={JS.push_focus()}> <.link navigate={~p"/authors/#{@author}/edit"}>
<.button>Edit author</.button> <.button>Edit author</.button>
</.link> </.link>
</:actions> </:actions>
@ -26,23 +26,6 @@ defmodule DecentralisedBookIndexWeb.AuthorLive.Show do
</.list> </.list>
<.back navigate={~p"/authors"}>Back to authors</.back> <.back navigate={~p"/authors"}>Back to authors</.back>
<.modal
:if={@live_action == :edit}
id="author-modal"
show
on_cancel={JS.patch(~p"/authors/#{@author}")}
>
<.live_component
module={DecentralisedBookIndexWeb.AuthorLive.FormComponent}
id={@author.id}
title={@page_title}
action={@live_action}
current_user={@current_user}
author={@author}
patch={~p"/authors/#{@author}"}
/>
</.modal>
""" """
end end

Loading…
Cancel
Save