From 5cc68bca6df61ce3614a0f2113749b46e0f75aa2 Mon Sep 17 00:00:00 2001 From: mr Date: Thu, 23 Jan 2025 14:36:19 +0100 Subject: [PATCH] light modification --- .../collaborative_area/collaborative_area_mongo_accessor.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/models/collaborative_area/collaborative_area_mongo_accessor.go b/models/collaborative_area/collaborative_area_mongo_accessor.go index a4c3a19..10a6275 100644 --- a/models/collaborative_area/collaborative_area_mongo_accessor.go +++ b/models/collaborative_area/collaborative_area_mongo_accessor.go @@ -68,11 +68,11 @@ func (a *collaborativeAreaMongoAccessor) StoreOne(data utils.DBObject) (utils.DB data.(*CollaborativeArea).Clear(id) // set the creator // retrieve or proper peer dd, code, err := a.peerAccessor.Search(&dbs.Filters{ - And: map[string][]dbs.Filter{ + Or: map[string][]dbs.Filter{ "state": {{Operator: dbs.EQUAL.String(), Value: 0}}, - }}, "", true) + }}, "", false) fmt.Println(dd, code, err) - if code != 200 || dd == nil { + if code != 200 || dd == nil || len(dd) == 0 { return nil, code, errors.New("could not retrieve the peer") } if data.(*CollaborativeArea).CollaborativeAreaRule != nil {