diff --git a/internal/repository/alert.go b/internal/repository/alert.go index a14d8c02..93649ab9 100644 --- a/internal/repository/alert.go +++ b/internal/repository/alert.go @@ -218,8 +218,8 @@ func reflectAlert(alert Alert) (out domain.Alert) { log.Error(err) } - outAlertActions := make([]domain.AlertAction, len(alert.AlertActions)) - if err := serializer.Map(outAlertActions, &out.AlertActions); err != nil { + out.AlertActions = make([]domain.AlertAction, len(alert.AlertActions)) + if err := serializer.Map(alert.AlertActions, &out.AlertActions); err != nil { log.Error(err) } return diff --git a/internal/repository/cluster.go b/internal/repository/cluster.go index cbca9e04..83f0faf3 100644 --- a/internal/repository/cluster.go +++ b/internal/repository/cluster.go @@ -264,11 +264,3 @@ func reflectCluster(cluster Cluster) (out domain.Cluster) { } return } - -func reflectSimpleCluster(cluster Cluster) domain.Cluster { - return domain.Cluster{ - ID: cluster.ID, - OrganizationId: cluster.OrganizationId, - Name: cluster.Name, - } -} diff --git a/internal/repository/stack-template.go b/internal/repository/stack-template.go index 3176e083..775e1813 100644 --- a/internal/repository/stack-template.go +++ b/internal/repository/stack-template.go @@ -133,26 +133,6 @@ func (r *StackTemplateRepository) Delete(dto domain.StackTemplate) (err error) { return nil } -func reflectStackTemplate2(stackTemplate StackTemplate) (out domain.StackTemplate) { - return domain.StackTemplate{ - ID: stackTemplate.ID, - OrganizationId: stackTemplate.OrganizationId, - Name: stackTemplate.Name, - Description: stackTemplate.Description, - Template: stackTemplate.Template, - CloudService: stackTemplate.CloudService, - Platform: stackTemplate.Platform, - Version: stackTemplate.Version, - KubeVersion: stackTemplate.KubeVersion, - KubeType: stackTemplate.KubeType, - Services: stackTemplate.Services, - Creator: reflectSimpleUser(stackTemplate.Creator), - Updator: reflectSimpleUser(stackTemplate.Updator), - CreatedAt: stackTemplate.CreatedAt, - UpdatedAt: stackTemplate.UpdatedAt, - } -} - func reflectStackTemplate(stackTemplate StackTemplate) (out domain.StackTemplate) { if err := serializer.Map(stackTemplate, &out); err != nil { log.Error(err) diff --git a/internal/repository/user.go b/internal/repository/user.go index 2571b1f6..c4c254c3 100644 --- a/internal/repository/user.go +++ b/internal/repository/user.go @@ -506,16 +506,3 @@ func (r *UserRepository) reflectRole(role Role) domain.Role { UpdatedAt: role.UpdatedAt, } } - -func reflectSimpleUser(user User) domain.User { - return domain.User{ - ID: user.ID.String(), - AccountId: user.AccountId, - Name: user.Name, - Email: user.Email, - Department: user.Department, - Description: user.Description, - CreatedAt: user.CreatedAt, - UpdatedAt: user.UpdatedAt, - } -}