correct workflow problem
This commit is contained in:
parent
ede91cde45
commit
4a3707efcf
@ -26,10 +26,6 @@ func (wfa *workspaceMongoAccessor) DeleteOne(id string) (utils.DBObject, int, er
|
||||
}
|
||||
|
||||
func (wfa *workspaceMongoAccessor) UpdateOne(set utils.DBObject, id string) (utils.DBObject, int, error) {
|
||||
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")
|
||||
}
|
||||
d := set.(*Workspace)
|
||||
d.DataResources = nil
|
||||
d.DatacenterResources = nil
|
||||
@ -51,6 +47,10 @@ func (wfa *workspaceMongoAccessor) UpdateOne(set utils.DBObject, id string) (uti
|
||||
}
|
||||
|
||||
func (wfa *workspaceMongoAccessor) StoreOne(data utils.DBObject) (utils.DBObject, int, error) {
|
||||
res, _, err := wfa.Search(nil, data.GetName())
|
||||
if err == nil && len(res) > 0 {
|
||||
return nil, 409, errors.New("A workspace with the same name already exists")
|
||||
}
|
||||
d := data.(*Workspace)
|
||||
d.DataResources = nil
|
||||
d.DatacenterResources = nil
|
||||
|
Loading…
Reference in New Issue
Block a user