mirror of
https://github.com/HendrikRauh/inventree-app.git
synced 2026-01-13 11:36:24 +00:00
Add "Category display" view
- Select "parts" from the app drawer - Allow traversal of sub-categories
This commit is contained in:
parent
f9dddfe3a2
commit
01faed03ee
4 changed files with 221 additions and 0 deletions
|
|
@ -69,6 +69,24 @@ class InvenTreeModel {
|
|||
}
|
||||
*/
|
||||
|
||||
// Return the detail view for the associated pk
|
||||
Future<InvenTreeModel> get(int pk) async {
|
||||
|
||||
// TODO - Add "timeout"
|
||||
// TODO - Add error catching
|
||||
|
||||
var response = await InvenTreeAPI().get(path.join(URL, pk.toString()));
|
||||
|
||||
if (response.statusCode != 200) {
|
||||
print("Error retrieving data");
|
||||
return null;
|
||||
}
|
||||
|
||||
final data = json.decode(response.body);
|
||||
|
||||
return createFromJson(data);
|
||||
}
|
||||
|
||||
// Return list of objects from the database, with optional filters
|
||||
Future<List<InvenTreeModel>> list({Map<String, String> filters}) async {
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue