debug automation workspace

This commit is contained in:
mr 2024-07-30 16:30:44 +02:00
parent b06193add2
commit 18d54cdb8f

View File

@ -50,9 +50,14 @@ func (wfa *WorkspaceMongoAccessor) LoadOne(id string) (utils.DBObject, int, erro
return nil, code, err
}
res_mongo.Decode(&workflow)
obj := &Workspace{Active: false}
mongo.MONGOService.UpdateMultiple(obj, map[string]interface{}{"active": true}, wfa.GetType())
obj = &Workspace{Active: true}
results, _, err := wfa.LoadAll()
if err == nil && len(results) > 0 {
for _, r := range results {
r.(*Workspace).Active = false
wfa.UpdateOne(&Workspace{Active: false}, r.GetID())
}
}
obj := &Workspace{Active: true}
wfa.UpdateOne(obj, id)
if workflow.Datas != nil && len(workflow.Datas) > 0 {