simplify call to peer

This commit is contained in:
mr 2024-08-26 16:39:16 +02:00
parent 00625eabd6
commit 143fe1446e

View File

@ -177,6 +177,15 @@ func (wfa *sharedWorkspaceMongoAccessor) StoreOne(data utils.DBObject) (utils.DB
data.(*SharedWorkspace).CreatorID = id data.(*SharedWorkspace).CreatorID = id
data.(*SharedWorkspace).Peers = append(data.(*SharedWorkspace).Peers, id) data.(*SharedWorkspace).Peers = append(data.(*SharedWorkspace).Peers, id)
d, code, err := wfa.GenericStoreOne(data.(*SharedWorkspace), wfa) d, code, err := wfa.GenericStoreOne(data.(*SharedWorkspace), wfa)
if data.(*SharedWorkspace).Workspaces == nil {
data.(*SharedWorkspace).Workspaces = []string{}
}
if data.(*SharedWorkspace).Workflows == nil {
data.(*SharedWorkspace).Workflows = []string{}
}
if data.(*SharedWorkspace).Rules == nil {
data.(*SharedWorkspace).Rules = []string{}
}
if code == 200 { if code == 200 {
wfa.sharedWorkflow(d.(*SharedWorkspace), d.GetID()) wfa.sharedWorkflow(d.(*SharedWorkspace), d.GetID())
wfa.sharedWorkspace(d.(*SharedWorkspace), d.GetID()) wfa.sharedWorkspace(d.(*SharedWorkspace), d.GetID())