Update the Authors Index LiveView to use the search_resource component.
This commit is contained in:
@@ -10,11 +10,13 @@ defmodule DecentralisedBookIndexWeb.AuthorLive.Index do
|
||||
Listing Authors
|
||||
</.header>
|
||||
|
||||
<.author_search
|
||||
<.search_resources
|
||||
search_query={@search_query}
|
||||
select_options={@select_options}
|
||||
selected_option={@sort_by}
|
||||
current_user={@current_user}
|
||||
resource_type="author"
|
||||
resource_new_url={~p"/authors/new"}
|
||||
/>
|
||||
|
||||
<%= if Enum.empty?(@page.results) do %>
|
||||
@@ -66,10 +68,6 @@ defmodule DecentralisedBookIndexWeb.AuthorLive.Index do
|
||||
def mount(_params, _session, socket) do
|
||||
{:ok,
|
||||
socket
|
||||
|> stream(
|
||||
:authors,
|
||||
Ash.read!(DecentralisedBookIndex.Metadata.Author, actor: socket.assigns[:current_user])
|
||||
)
|
||||
|> assign_new(:current_user, fn -> nil end)}
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user