Fix wsl_v5 lint errors and exclude node_modules from linting
This commit is contained in:
@@ -463,7 +463,9 @@ func (r *riskResolver) Scenarios(ctx context.Context, obj *types.Risk, first *in
|
||||
if err := r.authorize(ctx, obj.ID, probo.ActionRiskAssessmentScenarioList); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
scope := coredata.NewScopeFromObjectID(obj.ID)
|
||||
|
||||
pageOrderBy := page.OrderBy[coredata.RiskAssessmentScenarioOrderField]{
|
||||
Field: coredata.RiskAssessmentScenarioOrderFieldCreatedAt,
|
||||
Direction: page.OrderDirectionDesc,
|
||||
@@ -471,12 +473,15 @@ func (r *riskResolver) Scenarios(ctx context.Context, obj *types.Risk, first *in
|
||||
if orderBy != nil {
|
||||
pageOrderBy = page.OrderBy[coredata.RiskAssessmentScenarioOrderField]{Field: orderBy.Field, Direction: orderBy.Direction}
|
||||
}
|
||||
|
||||
cursor := types.NewCursor(first, after, last, before, pageOrderBy)
|
||||
|
||||
p, err := r.riskManagement.ListScenariosForRiskID(ctx, scope, obj.ID, cursor)
|
||||
if err != nil {
|
||||
r.logger.ErrorCtx(ctx, "cannot list risk scenarios", log.Error(err))
|
||||
return nil, gqlutils.Internal(ctx)
|
||||
}
|
||||
|
||||
return types.NewRiskAssessmentScenarioConnection(p, r, obj.ID), nil
|
||||
}
|
||||
|
||||
@@ -512,11 +517,13 @@ func (r *riskConnectionResolver) TotalCount(ctx context.Context, obj *types.Risk
|
||||
return count, nil
|
||||
case *riskAssessmentScenarioResolver:
|
||||
scope := coredata.NewScopeFromObjectID(obj.ParentID)
|
||||
|
||||
count, err := r.riskManagement.CountRisksForScenarioID(ctx, scope, obj.ParentID)
|
||||
if err != nil {
|
||||
r.logger.ErrorCtx(ctx, "cannot count scenario risks", log.Error(err))
|
||||
return 0, gqlutils.Internal(ctx)
|
||||
}
|
||||
|
||||
return count, nil
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user