light modification

This commit is contained in:
mr 2025-01-23 10:33:43 +01:00
parent 8cba10c4fe
commit 386881c283

View File

@ -67,8 +67,10 @@ func (a *collaborativeAreaMongoAccessor) StoreOne(data utils.DBObject) (utils.DB
_, id := (&peer.Peer{}).IsMySelf() // get the local peer
data.(*CollaborativeArea).Clear(id) // set the creator
// retrieve or proper peer
dd, code, err := a.peerAccessor.Search(nil, "0", true)
dd, code, err := a.peerAccessor.Search(&dbs.Filters{
And: map[string][]dbs.Filter{
"state": {{Operator: dbs.EQUAL.String(), Value: 0}},
}}, "", true)
if code != 200 || dd == nil || len(dd) == 0 {
return nil, code, errors.New("Could not retrieve the peer" + err.Error())
}