diff --git a/api/ws/handlers/expression.go b/api/ws/handlers/expression.go index 2a813632..7abd5254 100644 --- a/api/ws/handlers/expression.go +++ b/api/ws/handlers/expression.go @@ -145,7 +145,6 @@ func createExpression(expr *protos.DataExpression, hctx wsHelpers.HandlerContext if err != nil { return nil, err } - expr.Owner = wsHelpers.MakeOwnerSummary(ownerItem, hctx.SessUser, hctx.Svcs.MongoDB, hctx.Svcs.TimeStamper) return expr, nil } diff --git a/api/ws/handlers/quantification-retrieval.go b/api/ws/handlers/quantification-retrieval.go index 0c4c1c86..4b13c707 100644 --- a/api/ws/handlers/quantification-retrieval.go +++ b/api/ws/handlers/quantification-retrieval.go @@ -12,7 +12,7 @@ import ( ) func HandleQuantListReq(req *protos.QuantListReq, hctx wsHelpers.HandlerContext) (*protos.QuantListResp, error) { - filter, _, err := wsHelpers.MakeFilter(req.SearchParams, false, protos.ObjectType_OT_QUANTIFICATION, hctx) + filter, idToOwner, err := wsHelpers.MakeFilter(req.SearchParams, false, protos.ObjectType_OT_QUANTIFICATION, hctx) if err != nil { return nil, err } @@ -35,6 +35,9 @@ func HandleQuantListReq(req *protos.QuantListReq, hctx wsHelpers.HandlerContext) quants := []*protos.QuantificationSummary{} for _, item := range items { + if owner, ok := idToOwner[item.Id]; ok { + item.Owner = wsHelpers.MakeOwnerSummary(owner, hctx.SessUser, hctx.Svcs.MongoDB, hctx.Svcs.TimeStamper) + } quants = append(quants, item) } @@ -44,7 +47,7 @@ func HandleQuantListReq(req *protos.QuantListReq, hctx wsHelpers.HandlerContext) } func HandleQuantGetReq(req *protos.QuantGetReq, hctx wsHelpers.HandlerContext) (*protos.QuantGetResp, error) { - dbItem, _, err := wsHelpers.GetUserObjectById[protos.QuantificationSummary](false, req.QuantId, protos.ObjectType_OT_QUANTIFICATION, dbCollections.QuantificationsName, hctx) + dbItem, ownerItem, err := wsHelpers.GetUserObjectById[protos.QuantificationSummary](false, req.QuantId, protos.ObjectType_OT_QUANTIFICATION, dbCollections.QuantificationsName, hctx) if err != nil { return nil, err } @@ -62,6 +65,8 @@ func HandleQuantGetReq(req *protos.QuantGetReq, hctx wsHelpers.HandlerContext) ( } } + dbItem.Owner = wsHelpers.MakeOwnerSummary(ownerItem, hctx.SessUser, hctx.Svcs.MongoDB, hctx.Svcs.TimeStamper) + return &protos.QuantGetResp{ Summary: dbItem, Data: quant, diff --git a/api/ws/handlers/screen-configuration.go b/api/ws/handlers/screen-configuration.go index 3f675cb0..4d83fac5 100644 --- a/api/ws/handlers/screen-configuration.go +++ b/api/ws/handlers/screen-configuration.go @@ -134,6 +134,7 @@ func writeScreenConfiguration(screenConfig *protos.ScreenConfiguration, hctx wsH configuration.Name = screenConfig.Name configuration.Tags = screenConfig.Tags configuration.Description = screenConfig.Description + configuration.ScanConfigurations = screenConfig.ScanConfigurations _, err = hctx.Svcs.MongoDB.Collection(dbCollections.ScreenConfigurationName).UpdateByID(sessCtx, screenConfig.Id, bson.D{{ Key: "$set", @@ -183,7 +184,7 @@ func writeScreenConfiguration(screenConfig *protos.ScreenConfiguration, hctx wsH return nil, err } - screenConfig.Owner = wsHelpers.MakeOwnerSummary(owner, hctx.SessUser, hctx.Svcs.MongoDB, hctx.Svcs.TimeStamper) + configuration.Owner = wsHelpers.MakeOwnerSummary(owner, hctx.SessUser, hctx.Svcs.MongoDB, hctx.Svcs.TimeStamper) return configuration, nil }