diff --git a/apps/console/src/hooks/forms/useRiskForm.tsx b/apps/console/src/hooks/forms/useRiskForm.tsx index 3018db957..144f4de99 100644 --- a/apps/console/src/hooks/forms/useRiskForm.tsx +++ b/apps/console/src/hooks/forms/useRiskForm.tsx @@ -42,6 +42,10 @@ const RiskFragment = graphql` # eslint-disable-next-line relay/unused-fields residualImpact # eslint-disable-next-line relay/unused-fields + inherentRiskScore + # eslint-disable-next-line relay/unused-fields + residualRiskScore + # eslint-disable-next-line relay/unused-fields note owner { id diff --git a/pkg/coredata/risk.go b/pkg/coredata/risk.go index 6e7ad792c..e9391c185 100644 --- a/pkg/coredata/risk.go +++ b/pkg/coredata/risk.go @@ -506,6 +506,7 @@ SET WHERE %s AND id = @risk_id AND snapshot_id IS NULL +RETURNING inherent_risk_score, residual_risk_score ` q = fmt.Sprintf(q, scope.SQLFragment()) @@ -525,8 +526,15 @@ WHERE %s } maps.Copy(args, scope.SQLArguments()) - _, err := conn.Exec(ctx, q, args) - return err + err := conn.QueryRow(ctx, q, args).Scan( + &r.InherentRiskScore, + &r.ResidualRiskScore, + ) + if err != nil { + return fmt.Errorf("cannot update risk: %w", err) + } + + return nil } func (r *Risk) Delete(