feat(admin-ui): Encode location id in URL on location table (#3533)
Encoded the `location_id` into the query params and ensured it gets parsed on mount, into defaults. This allows safer refreshes of the locations table or accurate deep-links to be shared. Resolves CORE-1252
This commit is contained in:
@@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
"@medusajs/admin-ui": patch
|
||||||
|
---
|
||||||
|
|
||||||
|
feat(admin-ui): Encode location id in URL on location table
|
||||||
+3
-3
@@ -25,7 +25,7 @@ interface InventoryFilterState {
|
|||||||
additionalFilters: InventoryDefaultFilters | null
|
additionalFilters: InventoryDefaultFilters | null
|
||||||
}
|
}
|
||||||
|
|
||||||
const allowedFilters = ["location", "q", "offset", "limit"]
|
const allowedFilters = ["q", "offset", "limit", "location_id"]
|
||||||
|
|
||||||
const DefaultTabs = {}
|
const DefaultTabs = {}
|
||||||
|
|
||||||
@@ -226,8 +226,8 @@ export const useInventoryFilters = (
|
|||||||
if (value && typeof value === "string") {
|
if (value && typeof value === "string") {
|
||||||
toQuery["q"] = value
|
toQuery["q"] = value
|
||||||
}
|
}
|
||||||
} else if (key === "offset" || key === "limit") {
|
} else if (key === "offset" || key === "limit" || key === "location") {
|
||||||
toQuery[key] = value
|
toQuery[stateFilterMap[key] || key] = value
|
||||||
} else if (value.open) {
|
} else if (value.open) {
|
||||||
toQuery[stateFilterMap[key]] = value.filter
|
toQuery[stateFilterMap[key]] = value.filter
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user