This commit is contained in:
mr 2024-11-06 09:41:46 +01:00
parent 5f05b73366
commit e4860ff67e

View File

@ -1,7 +1,6 @@
package peer
import (
"fmt"
"strconv"
"cloud.o-forge.io/core/oc-lib/dbs"
@ -71,7 +70,6 @@ func (wfa *peerMongoAccessor) Search(filters *dbs.Filters, search string) ([]uti
objs := []utils.ShallowDBObject{}
if (filters == nil || len(filters.And) == 0 || len(filters.Or) == 0) && search != "" {
s, err := strconv.Atoi(search)
fmt.Println(s, err, search)
if err == nil {
filters = &dbs.Filters{
Or: map[string][]dbs.Filter{ // search by name if no filters are provided