2
0
mirror of https://github.com/inventree/inventree-app.git synced 2025-06-17 04:35:26 +00:00

Remove typeahead library

This commit is contained in:
Oliver
2021-07-26 23:04:43 +10:00
parent 978cefd6bf
commit 08eb6fc4b1
6 changed files with 71 additions and 85 deletions

View File

@ -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);