From 8e78c533c4a971e4737cdf65a52fe2a5d811b52a Mon Sep 17 00:00:00 2001 From: Rares Stefan Date: Wed, 15 Mar 2023 13:20:30 +0100 Subject: [PATCH] fix(admin-ui): Fix inventory table pagination on location filter change (#3479) Inventory table offset should now correctly reset when a new location is selected from the filtering dropdown. Resolves CORE-1231. --- .changeset/late-dots-lie.md | 5 +++++ .../templates/inventory-table/use-inventory-filters.ts | 1 + 2 files changed, 6 insertions(+) create mode 100644 .changeset/late-dots-lie.md diff --git a/.changeset/late-dots-lie.md b/.changeset/late-dots-lie.md new file mode 100644 index 0000000000..17d9dc9bc5 --- /dev/null +++ b/.changeset/late-dots-lie.md @@ -0,0 +1,5 @@ +--- +"@medusajs/admin-ui": patch +--- + +fix(admin-ui): Fix inventory table pagination on location filter change diff --git a/packages/admin-ui/ui/src/components/templates/inventory-table/use-inventory-filters.ts b/packages/admin-ui/ui/src/components/templates/inventory-table/use-inventory-filters.ts index db3bb53465..b529c5b793 100644 --- a/packages/admin-ui/ui/src/components/templates/inventory-table/use-inventory-filters.ts +++ b/packages/admin-ui/ui/src/components/templates/inventory-table/use-inventory-filters.ts @@ -154,6 +154,7 @@ export const useInventoryFilters = ( const setLocationFilter = (loc: string) => { dispatch({ type: "setLocation", payload: loc }) + dispatch({ type: "setOffset", payload: 0 }) } const paginate = (direction: 1 | -1) => {