COMPLEX SEARCH

This commit is contained in:
mr 2024-08-01 09:34:44 +02:00
parent 924a688a9d
commit 745e175da4

View File

@ -76,7 +76,7 @@ func (wfa storageMongoAccessor) LoadAll() ([]utils.ShallowDBObject, int, error)
func (wfa *storageMongoAccessor) Search(filters *dbs.Filters, search string) ([]utils.ShallowDBObject, int, error) {
objs := []utils.ShallowDBObject{}
if (len(filters.And) == 0 || len(filters.Or) == 0) && search != "" {
if (filters == nil || len(filters.And) == 0 || len(filters.Or) == 0) && search != "" {
filters = &dbs.Filters{
Or: map[string]dbs.Filter{
"abstractresource.abstractobject.name": {Operator: dbs.LIKE.String(), Value: search},