Compare commits

..

1 Commits

Author SHA1 Message Date
0729c63c3a add search to notes
Some checks are pending
continuous-integration/drone/push Build is pending
2022-11-19 00:19:55 -05:00
2 changed files with 5 additions and 1 deletions

View File

@ -3,6 +3,10 @@ defmodule MemexWeb.NoteLive.Index do
alias Memex.{Notes, Notes.Note}
@impl true
def mount(%{"search" => search}, _session, socket) do
{:ok, socket |> assign(search: search) |> display_notes()}
end
def mount(_params, _session, socket) do
{:ok, socket |> assign(search: nil) |> display_notes()}
end

View File

@ -11,7 +11,7 @@
phx-debounce="500"
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>
<%= if @notes |> Enum.empty?() do %>