diff --git a/lib/music_library_web/live/collection_live/show.ex b/lib/music_library_web/live/collection_live/show.ex index 2a44d203..2c469be3 100644 --- a/lib/music_library_web/live/collection_live/show.ex +++ b/lib/music_library_web/live/collection_live/show.ex @@ -167,7 +167,7 @@ defmodule MusicLibraryWeb.CollectionLive.Show do <.dropdown_link id={"actions-#{@record.id}-populate-genres"} - phx-click={JS.push("populate_genres", value: %{id: @record.id})} + phx-click={JS.push("populate_genres")} > <.icon name="hero-sparkles" @@ -180,7 +180,7 @@ defmodule MusicLibraryWeb.CollectionLive.Show do <.dropdown_link id={"actions-#{@record.id}-regenerate-embeddings"} - phx-click={JS.push("regenerate_embeddings", value: %{id: @record.id})} + phx-click={JS.push("regenerate_embeddings")} > <.icon name="hero-sparkles" @@ -398,8 +398,8 @@ defmodule MusicLibraryWeb.CollectionLive.Show do end end - def handle_event("populate_genres", %{"id" => id}, socket) do - record = Records.get_record!(id) + def handle_event("populate_genres", _params, socket) do + record = socket.assigns.record case Records.populate_genres_async(record) do {:ok, _worker} -> @@ -457,8 +457,8 @@ defmodule MusicLibraryWeb.CollectionLive.Show do end end - def handle_event("regenerate_embeddings", %{"id" => id}, socket) do - record = Records.get_record!(id) + def handle_event("regenerate_embeddings", _params, socket) do + record = socket.assigns.record case Similarity.generate_embedding_async(record) do {:ok, _worker} -> diff --git a/lib/music_library_web/live/wishlist_live/show.ex b/lib/music_library_web/live/wishlist_live/show.ex index 483db266..ac2da60a 100644 --- a/lib/music_library_web/live/wishlist_live/show.ex +++ b/lib/music_library_web/live/wishlist_live/show.ex @@ -121,7 +121,7 @@ defmodule MusicLibraryWeb.WishlistLive.Show do <.dropdown_link id={"actions-#{@record.id}-populate-genres"} - phx-click={JS.push("populate_genres", value: %{id: @record.id})} + phx-click={JS.push("populate_genres")} > <.icon name="hero-sparkles" @@ -349,8 +349,8 @@ defmodule MusicLibraryWeb.WishlistLive.Show do end end - def handle_event("populate_genres", %{"id" => id}, socket) do - record = Records.get_record!(id) + def handle_event("populate_genres", _params, socket) do + record = socket.assigns.record case Records.populate_genres_async(record) do {:ok, _worker} ->