Skip to content

Commit

Permalink
chore: fix page_link_params calls in data_table (#270) (#271)
Browse files Browse the repository at this point in the history
  • Loading branch information
mkschell authored Feb 10, 2025
1 parent 1747fab commit 6de6651
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions lib/ash_admin/components/resource/data_table.ex
Original file line number Diff line number Diff line change
Expand Up @@ -246,21 +246,23 @@ defmodule AshAdmin.Components.Resource.DataTable do
end

def handle_event("next_page", _, socket) do
params = %{"page" => page_link_params(socket.assigns.data, "next")}
params = %{"page" => AshPhoenix.LiveView.page_link_params(socket.assigns.data, "next")}

{:noreply,
push_patch(socket, to: self_path(socket.assigns.url_path, socket.assigns.params, params))}
end

def handle_event("prev_page", _, socket) do
params = %{"page" => page_link_params(socket.assigns.data, "prev")}
params = %{"page" => AshPhoenix.LiveView.page_link_params(socket.assigns.data, "prev")}

{:noreply,
push_patch(socket, to: self_path(socket.assigns.url_path, socket.assigns.params, params))}
end

def handle_event("specific_page", %{"page" => page}, socket) do
params = %{"page" => page_link_params(socket.assigns.data, String.to_integer(page))}
params = %{
"page" => AshPhoenix.LiveView.page_link_params(socket.assigns.data, String.to_integer(page))

Check warning on line 264 in lib/ash_admin/components/resource/data_table.ex

View workflow job for this annotation

GitHub Actions / ash-ci / mix dialyzer

call

The function call page_link_params will not succeed.
}

{:noreply,
push_patch(socket, to: self_path(socket.assigns.url_path, socket.assigns.params, params))}
Expand Down

0 comments on commit 6de6651

Please sign in to comment.