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

Adds search results

This commit is contained in:
Oliver Walters
2021-02-12 22:38:33 +11:00
parent 9cf8559569
commit d1e612698e
4 changed files with 198 additions and 48 deletions

View File

@ -84,21 +84,15 @@ class InvenTreeModel {
// Return the API detail endpoint for this Model object
String get url => "${URL}/${pk}/";
/*
// Search this Model type in the database
Future<List<InvenTreeModel>> search(String searchTerm) async {
Future<List<InvenTreeModel>> search(BuildContext context, String searchTerm) async {
String addr = url + "?search=" + search;
final results = list(context, filters: {"cascade": "true", "search": searchTerm});
print("Searching endpoint: $url");
// TODO - Add "timeout"
// TODO - Add error catching
var response =
return results;
}
*/
Map<String, String> defaultListFilters() { return Map<String, String>(); }