casual debug, time added before change of state bookin & exec

This commit is contained in:
mr
2025-02-19 08:55:11 +01:00
parent 7c30633bde
commit 241c6a5a08
4 changed files with 20 additions and 10 deletions

View File

@@ -72,9 +72,11 @@ func (a *workspaceMongoAccessor) UpdateOne(set utils.DBObject, id string) (utils
func (a *workspaceMongoAccessor) StoreOne(data utils.DBObject) (utils.DBObject, int, error) {
filters := &dbs.Filters{
Or: map[string][]dbs.Filter{
"abstractobject.name": {{Operator: dbs.LIKE.String(), Value: data.GetName() + "_workspace"}},
"abstractobject.name": {{Operator: dbs.LIKE.String(), Value: data.GetName() + "_workspace"}},
"abstractobject.creator_id": {{Operator: dbs.EQUAL.String(), Value: a.GetPeerID()}},
},
}
// filters *dbs.Filters, word string, isDraft bool
res, _, err := a.Search(filters, "", true) // Search for the workspace
if err == nil && len(res) > 0 { // If the workspace already exists, return an error
return nil, 409, errors.New("a workspace with the same name already exists")