simplify call to peer

This commit is contained in:
mr 2024-08-26 16:52:24 +02:00
parent 143fe1446e
commit 767c14044f

View File

@ -176,7 +176,6 @@ func (wfa *sharedWorkspaceMongoAccessor) StoreOne(data utils.DBObject) (utils.DB
id, _ := static.GetMyLocalJsonPeer()
data.(*SharedWorkspace).CreatorID = id
data.(*SharedWorkspace).Peers = append(data.(*SharedWorkspace).Peers, id)
d, code, err := wfa.GenericStoreOne(data.(*SharedWorkspace), wfa)
if data.(*SharedWorkspace).Workspaces == nil {
data.(*SharedWorkspace).Workspaces = []string{}
}
@ -186,6 +185,9 @@ func (wfa *sharedWorkspaceMongoAccessor) StoreOne(data utils.DBObject) (utils.DB
if data.(*SharedWorkspace).Rules == nil {
data.(*SharedWorkspace).Rules = []string{}
}
d, code, err := wfa.GenericStoreOne(data.(*SharedWorkspace), wfa)
if code == 200 {
wfa.sharedWorkflow(d.(*SharedWorkspace), d.GetID())
wfa.sharedWorkspace(d.(*SharedWorkspace), d.GetID())