Compare commits

..

1 Commits

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

View File

@ -3,10 +3,6 @@ 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

View File

@ -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", value: @search) %> <%= text_input(f, :search_term, class: "input input-primary") %>
</.form> </.form>
<%= if @notes |> Enum.empty?() do %> <%= if @notes |> Enum.empty?() do %>