mirror of
https://github.com/HendrikRauh/inventree-app.git
synced 2026-01-13 03:26:24 +00:00
Remove typeahead library
This commit is contained in:
parent
978cefd6bf
commit
08eb6fc4b1
6 changed files with 71 additions and 85 deletions
|
|
@ -285,11 +285,17 @@ class InvenTreeModel {
|
|||
return results;
|
||||
}
|
||||
|
||||
// TODO - handle possible error cases:
|
||||
// - No data receieved
|
||||
// - Data is not a list of maps
|
||||
dynamic data;
|
||||
|
||||
for (var d in response.data) {
|
||||
if (response.data is List) {
|
||||
data = response.data;
|
||||
} else if (response.data.containsKey('results')) {
|
||||
data = response.data['results'];
|
||||
} else {
|
||||
data = [];
|
||||
}
|
||||
|
||||
for (var d in data) {
|
||||
|
||||
// Create a new object (of the current class type
|
||||
InvenTreeModel obj = createFromJson(d);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue