diff --git a/management/server/policy.go b/management/server/policy.go index 5cc641c45..d3286f2d3 100644 --- a/management/server/policy.go +++ b/management/server/policy.go @@ -36,6 +36,7 @@ func (am *DefaultAccountManager) SavePolicy(ctx context.Context, accountID, user return err } + // TODO: split into separate create and update functions to avoid the isUpdate check saveFunc := transaction.CreatePolicy if isUpdate { action = activity.PolicyUpdated diff --git a/management/server/posture_checks.go b/management/server/posture_checks.go index 6220cb322..799cbf86f 100644 --- a/management/server/posture_checks.go +++ b/management/server/posture_checks.go @@ -28,6 +28,7 @@ func (am *DefaultAccountManager) SavePostureChecks(ctx context.Context, accountI return err } + // TODO: split into separate create and update functions to avoid the isUpdate check if isUpdate { updateAccountPeers, err = arePostureCheckChangesAffectPeers(ctx, transaction, accountID, postureChecks.ID) if err != nil {