mirror of
https://github.com/HendrikRauh/inventree-app.git
synced 2026-01-13 03:26:24 +00:00
Add custom search context for "category"
This commit is contained in:
parent
36f0d7b120
commit
858464d301
4 changed files with 32 additions and 89 deletions
|
|
@ -86,9 +86,15 @@ class InvenTreeModel {
|
|||
|
||||
|
||||
// Search this Model type in the database
|
||||
Future<List<InvenTreeModel>> search(BuildContext context, String searchTerm) async {
|
||||
Future<List<InvenTreeModel>> search(BuildContext context, String searchTerm, {Map<String, String> filters}) async {
|
||||
|
||||
final results = list(context, filters: {"cascade": "true", "search": searchTerm});
|
||||
if (filters == null) {
|
||||
filters = {};
|
||||
}
|
||||
|
||||
filters["search"] = searchTerm;
|
||||
|
||||
final results = list(context, filters: filters);
|
||||
|
||||
return results;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue