Browse Source

fix: wrong path helpers

main
Inhji Y. 4 months ago
parent
commit
d3534eeac1
  1. 3
      lib/mirage_web/live/goto_anything_live.ex
  2. 3
      lib/mirage_web/live/goto_anything_live.html.leex

3
lib/mirage_web/live/goto_anything_live.ex

@ -28,8 +28,7 @@ defmodule MirageWeb.GotoAnythingLive do
socket =
if not Enum.empty?(results) do
note = List.first(results)
push_redirect(socket, to: Routes.show_note_path(@socket, :show, note))
push_redirect(socket, to: Routes.note_show_path(socket, :show, note))
else
socket
end

3
lib/mirage_web/live/goto_anything_live.html.leex

@ -19,11 +19,10 @@
<div class="card result">
<strong><%= note.title %></strong>
<div>
<%= live_redirect "Go to Note", to: Routes.live_path(MirageWeb.Endpoint, MirageWeb.ShowNoteLive, note.id) %>
<%= live_redirect "Go to Note", to: Routes.note_show_path(@socket, :show, note.id) %>
</div>
</div>
<% end %>
<% end %>
</div>
</div>
Loading…
Cancel
Save