diff --git a/.changeset/wicked-cheetahs-fail.md b/.changeset/wicked-cheetahs-fail.md new file mode 100644 index 0000000000..9cb2cd77cc --- /dev/null +++ b/.changeset/wicked-cheetahs-fail.md @@ -0,0 +1,5 @@ +--- +"@medusajs/admin-ui": patch +--- + +feat(admin-ui): Encode location id in URL on location table 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 b529c5b793..090634cbe3 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 @@ -25,7 +25,7 @@ interface InventoryFilterState { additionalFilters: InventoryDefaultFilters | null } -const allowedFilters = ["location", "q", "offset", "limit"] +const allowedFilters = ["q", "offset", "limit", "location_id"] const DefaultTabs = {} @@ -226,8 +226,8 @@ export const useInventoryFilters = ( if (value && typeof value === "string") { toQuery["q"] = value } - } else if (key === "offset" || key === "limit") { - toQuery[key] = value + } else if (key === "offset" || key === "limit" || key === "location") { + toQuery[stateFilterMap[key] || key] = value } else if (value.open) { toQuery[stateFilterMap[key]] = value.filter }