Database governance built for humans and agents — controlling changes and access across every major database.
Go cicddata-governancedata-maskingdata-securitydatabase-accessdatabase-governancedevopsdevsecopsflywaygitopsliquibasemongodbmysqloraclepostgresqlschema-migrationssecuritysql-clientsqlservertidb
feat: allow updating risk.level (#5183)
p0nye9cfaccc05f4
diff --git a/backend/api/v1/risk_service.go b/backend/api/v1/risk_service.goindex fafb0e8f63..8916691987 100644--- a/backend/api/v1/risk_service.go+++ b/backend/api/v1/risk_service.go@@ -96,6 +96,8 @@ func (s *RiskService) UpdateRisk(ctx context.Context, request *v1pb.UpdateRiskRepatch.Name = &request.Risk.Titlecase "risk.active":patch.Active = &request.Risk.Active+ case "risk.level":+ patch.Level = &request.Risk.Levelcase "risk.expression":patch.Expression = request.Risk.Expression}diff --git a/backend/store/risk.go b/backend/store/risk.goindex 81f6be5fde..5c9d9a8116 100644--- a/backend/store/risk.go+++ b/backend/store/risk.go@@ -44,6 +44,7 @@ type RiskMessage struct {type UpdateRiskMessage struct {Name *stringActive *bool+ Level *int64Expression *v1alpha1.ParsedExprRowStatus *api.RowStatus}@@ -211,6 +212,9 @@ func (s *Store) UpdateRisk(ctx context.Context, patch *UpdateRiskMessage, id intif v := patch.Active; v != nil {set, args = append(set, fmt.Sprintf("active = $%d", len(args)+1)), append(args, *v)}+ if v := patch.Level; v != nil {+ set, args = append(set, fmt.Sprintf("level = $%d", len(args)+1)), append(args, *v)+ }if v := patch.Expression; v != nil {expressionBytes, err := protojson.Marshal(patch.Expression)if err != nil {