correct workflow problem

This commit is contained in:
mr 2024-08-28 15:52:27 +02:00
parent cf26fd970c
commit 14d6a5f11c

View File

@ -47,7 +47,12 @@ func (wfa *workspaceMongoAccessor) UpdateOne(set utils.DBObject, id string) (uti
} }
func (wfa *workspaceMongoAccessor) StoreOne(data utils.DBObject) (utils.DBObject, int, error) { func (wfa *workspaceMongoAccessor) StoreOne(data utils.DBObject) (utils.DBObject, int, error) {
res, _, err := wfa.Search(nil, data.GetName()) filters := &dbs.Filters{
Or: map[string][]dbs.Filter{
"abstractobject.name": {{dbs.LIKE.String(), data.GetName() + "_workspace"}},
},
}
res, _, err := wfa.Search(filters, "")
if err == nil && len(res) > 0 { if err == nil && len(res) > 0 {
return nil, 409, errors.New("A workspace with the same name already exists") return nil, 409, errors.New("A workspace with the same name already exists")
} }