From 63b02199f62fa55dfc9435bcb7764a8b51ef507c Mon Sep 17 00:00:00 2001 From: mr Date: Mon, 26 Aug 2024 15:28:51 +0200 Subject: [PATCH] simplify call to peer --- models/workspace/shared/shared_workspace_mongo_accessor.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/models/workspace/shared/shared_workspace_mongo_accessor.go b/models/workspace/shared/shared_workspace_mongo_accessor.go index 850e27d..c642d2f 100644 --- a/models/workspace/shared/shared_workspace_mongo_accessor.go +++ b/models/workspace/shared/shared_workspace_mongo_accessor.go @@ -10,6 +10,7 @@ import ( w "cloud.o-forge.io/core/oc-lib/models/workflow" "cloud.o-forge.io/core/oc-lib/models/workspace" "cloud.o-forge.io/core/oc-lib/models/workspace/shared/rules/rule" + "cloud.o-forge.io/core/oc-lib/static" "cloud.o-forge.io/core/oc-lib/tools" ) @@ -172,6 +173,9 @@ func (wfa *sharedWorkspaceMongoAccessor) UpdateOne(set utils.DBObject, id string } func (wfa *sharedWorkspaceMongoAccessor) StoreOne(data utils.DBObject) (utils.DBObject, int, error) { + id, _ := static.GetMyLocalJsonPeer() + data.(*SharedWorkspace).CreatorID = id + data.(*SharedWorkspace).Peers = append(data.(*SharedWorkspace).Peers, id) d, code, err := wfa.GenericStoreOne(data.(*SharedWorkspace), wfa) if code == 200 { wfa.sharedWorkflow(d.(*SharedWorkspace), d.GetID())