correct workflow problem
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
package workspace
|
||||
|
||||
import (
|
||||
"errors"
|
||||
|
||||
"cloud.o-forge.io/core/oc-lib/dbs"
|
||||
"cloud.o-forge.io/core/oc-lib/dbs/mongo"
|
||||
"cloud.o-forge.io/core/oc-lib/models/resources/data"
|
||||
@@ -41,6 +43,11 @@ func (wfa *workspaceMongoAccessor) UpdateOne(set utils.DBObject, id string) (uti
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
res, _, err := wfa.Search(nil, set.GetName())
|
||||
if err == nil && len(res) > 0 {
|
||||
return nil, 409, errors.New("A workspace with the same name already exists")
|
||||
}
|
||||
return wfa.GenericUpdateOne(set, id, wfa, &Workspace{})
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user