2
0
mirror of https://github.com/inventree/inventree-app.git synced 2025-04-28 13:36:50 +00:00

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; 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 @override
InvenTreeModel createFromJson(Map<String, dynamic> json) { InvenTreeModel createFromJson(Map<String, dynamic> json) {

View File

@ -1,7 +1,7 @@
name: inventree name: inventree
description: InvenTree stock management description: InvenTree stock management
version: 0.8.0+46 version: 0.8.1+47
environment: environment:
sdk: ">=2.16.0 <3.0.0" sdk: ">=2.16.0 <3.0.0"