Compare commits
1 Commits
4a5c09d819
...
0729c63c3a
Author | SHA1 | Date | |
---|---|---|---|
0729c63c3a |
@ -3,6 +3,10 @@ defmodule MemexWeb.NoteLive.Index do
|
|||||||
alias Memex.{Notes, Notes.Note}
|
alias Memex.{Notes, Notes.Note}
|
||||||
|
|
||||||
@impl true
|
@impl true
|
||||||
|
def mount(%{"search" => search}, _session, socket) do
|
||||||
|
{:ok, socket |> assign(search: search) |> display_notes()}
|
||||||
|
end
|
||||||
|
|
||||||
def mount(_params, _session, socket) do
|
def mount(_params, _session, socket) do
|
||||||
{:ok, socket |> assign(search: nil) |> display_notes()}
|
{:ok, socket |> assign(search: nil) |> display_notes()}
|
||||||
end
|
end
|
||||||
|
@ -11,7 +11,7 @@
|
|||||||
phx-debounce="500"
|
phx-debounce="500"
|
||||||
class="self-stretch flex flex-col items-stretch"
|
class="self-stretch flex flex-col items-stretch"
|
||||||
>
|
>
|
||||||
<%= text_input(f, :search_term, class: "input input-primary") %>
|
<%= text_input(f, :search_term, class: "input input-primary", value: @search) %>
|
||||||
</.form>
|
</.form>
|
||||||
|
|
||||||
<%= if @notes |> Enum.empty?() do %>
|
<%= if @notes |> Enum.empty?() do %>
|
||||||
|
Loading…
Reference in New Issue
Block a user