casual debug, time added before change of state bookin & exec
This commit is contained in:
@@ -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")
|
||||
|
Reference in New Issue
Block a user