index file
This commit is contained in:
parent
4ad3973e9b
commit
7c33ac7f78
8 changed files with 52 additions and 234 deletions
45
lib/wild_web/live/index.ex
Normal file
45
lib/wild_web/live/index.ex
Normal file
|
@ -0,0 +1,45 @@
|
|||
defmodule WildWeb.Index do
|
||||
use WildWeb, :live_view
|
||||
|
||||
@impl true
|
||||
def mount(_params, _session, socket) do
|
||||
# {:ok, stream(socket, :book_reads, BookReads.list_book_reads())}
|
||||
{:ok, socket}
|
||||
end
|
||||
|
||||
# @impl true
|
||||
# def handle_params(params, _url, socket) do
|
||||
# {:noreply, apply_action(socket, socket.assigns.live_action, params)}
|
||||
# end
|
||||
#
|
||||
# defp apply_action(socket, :edit, %{"id" => id}) do
|
||||
# socket
|
||||
# |> assign(:page_title, "Edit Book read")
|
||||
# |> assign(:book_read, BookReads.get_book_read!(id))
|
||||
# end
|
||||
#
|
||||
# defp apply_action(socket, :new, _params) do
|
||||
# socket
|
||||
# |> assign(:page_title, "New Book read")
|
||||
# |> assign(:book_read, %BookRead{})
|
||||
# end
|
||||
#
|
||||
# defp apply_action(socket, :index, _params) do
|
||||
# socket
|
||||
# |> assign(:page_title, "Listing Book reads")
|
||||
# |> assign(:book_read, nil)
|
||||
# end
|
||||
#
|
||||
# @impl true
|
||||
# def handle_info({WildWeb.BookReadLive.FormComponent, {:saved, book_read}}, socket) do
|
||||
# {:noreply, stream_insert(socket, :book_reads, book_read)}
|
||||
# end
|
||||
#
|
||||
# @impl true
|
||||
# def handle_event("delete", %{"id" => id}, socket) do
|
||||
# book_read = BookReads.get_book_read!(id)
|
||||
# {:ok, _} = BookReads.delete_book_read(book_read)
|
||||
#
|
||||
# {:noreply, stream_delete(socket, :book_reads, book_read)}
|
||||
# end
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue