From 55f89b2151cbdd506f91be5e08451c954caaf1fc Mon Sep 17 00:00:00 2001 From: docloulou Date: Mon, 22 Sep 2025 18:19:59 +0200 Subject: [PATCH] fix(dashboard): add offset and limit to query parameters in useTableConfiguration (#13565) This pull request introduces a minor update to the table configuration functionality in the dashboard package. The main change is the addition of pagination support through `offset` and `limit` query parameters. This fix pagination with `view_configurations:true` Pagination improvements: * [`packages/admin/dashboard/src/hooks/table/use-table-configuration.tsx`](diffhunk://#diff-2cf338f1bf284cf3568eabc51107b9a3d51a4b830a81baae2362f608f7c8a55aL71-R71): Updated the `useTableConfiguration` hook to include `offset` and `limit` in the query parameters, enabling pagination for table data. * [`.changeset/spicy-swans-grab.md`](diffhunk://#diff-1bada2c80b4c3b4ee3c8782ee24ca0183b1bee09aafd7fe130c481152458f1a4R1-R5): Documented the change as a minor update to `@medusajs/dashboard`, specifying the addition of `offset` and `limit` to query parameters in `useTableConfiguration`. --- .changeset/spicy-swans-grab.md | 5 +++++ .../dashboard/src/hooks/table/use-table-configuration.tsx | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 .changeset/spicy-swans-grab.md diff --git a/.changeset/spicy-swans-grab.md b/.changeset/spicy-swans-grab.md new file mode 100644 index 0000000000..ac4178426b --- /dev/null +++ b/.changeset/spicy-swans-grab.md @@ -0,0 +1,5 @@ +--- +"@medusajs/dashboard": patch +--- + +fix(dashboard): add offset and limit to query parameters in useTableConfiguration diff --git a/packages/admin/dashboard/src/hooks/table/use-table-configuration.tsx b/packages/admin/dashboard/src/hooks/table/use-table-configuration.tsx index 07e5f3e71e..da71d712c6 100644 --- a/packages/admin/dashboard/src/hooks/table/use-table-configuration.tsx +++ b/packages/admin/dashboard/src/hooks/table/use-table-configuration.tsx @@ -68,7 +68,7 @@ export function useTableConfiguration({ }) const queryParams = useQueryParams( - ["q", "order", ...filters.map(f => f.id)], + ["q", "order", "offset", "limit", ...filters.map(f => f.id)], queryPrefix )