correct workflow problem
This commit is contained in:
parent
cf26fd970c
commit
14d6a5f11c
@ -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")
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user