2
0
mirror of https://github.com/inventree/inventree-app.git synced 2025-06-16 04:05:28 +00:00

Filter fix (#473)

* Add check for "null" top level locations and categories

* Fix API

- Top level location and category broken after API 174
- Ref: https://github.com/inventree/InvenTree/pull/6536
This commit is contained in:
Oliver
2024-02-28 16:23:46 +11:00
committed by GitHub
parent 1d41d229ca
commit a889c4adbe
4 changed files with 29 additions and 7 deletions

View File

@ -200,13 +200,21 @@ class _CategoryDisplayState extends RefreshableState<CategoryDisplayWidget> {
// Construct the "details" panel
List<Widget> detailTiles() {
Map<String, String> filters = {};
int? parent = widget.category?.pk;
if (parent != null) {
filters["parent"] = parent.toString();
} else if (api.supportsNullTopLevelFiltering) {
filters["parent"] = "null";
}
List<Widget> tiles = <Widget>[
getCategoryDescriptionCard(),
Expanded(
child: PaginatedPartCategoryList(
{
"parent": widget.category?.pk.toString() ?? "null"
},
filters,
title: L10().subcategories,
),
flex: 10,