Update API to match server changes (#196)

* Support updated API which changes detail of PartCategory list

* Update version to 0.8.1
This commit is contained in:
Oliver 2022-08-01 11:22:56 +10:00 committed by GitHub
parent c5162c1947
commit b5d26580b4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 2 deletions

View file

@ -51,7 +51,9 @@ class InvenTreePartCategory extends InvenTreeModel {
return p;
}
int get partcount => (jsondata["parts"] ?? 0) as int;
// Return the number of parts in this category
// Note that the API changed from 'parts' to 'part_count' (v69)
int get partcount => (jsondata["part_count"] ?? jsondata["parts"] ?? 0) as int;
@override
InvenTreeModel createFromJson(Map<String, dynamic> json) {