Rename ErrCampaignNoScopeSources to ErrCampaignNoSourcesSelected
Align the sentinel name with the validation it represents. Signed-off-by: Cursor Agent <cursoragent@cursor.com> Co-authored-by: Bryan FRIMIN <bryan@frimin.fr>
This commit is contained in:
@@ -428,7 +428,7 @@ func (s *Service) StartCampaign(
|
||||
}
|
||||
|
||||
if len(campaignSources) == 0 {
|
||||
return ErrCampaignNoScopeSources
|
||||
return ErrCampaignNoSourcesSelected
|
||||
}
|
||||
|
||||
now := time.Now()
|
||||
|
||||
@@ -23,7 +23,7 @@ package accessreview
|
||||
import "errors"
|
||||
|
||||
var (
|
||||
ErrCampaignNoScopeSources = errors.New("cannot start campaign: no scope sources configured")
|
||||
ErrCampaignNoSourcesSelected = errors.New("cannot start campaign: no scope sources configured")
|
||||
ErrCampaignNotDraft = errors.New("campaign must be in draft status")
|
||||
ErrCampaignSourceOrganizationMismatch = errors.New("access source does not belong to the same organization")
|
||||
)
|
||||
|
||||
@@ -806,7 +806,7 @@ func (r *mutationResolver) StartAccessReviewCampaign(ctx context.Context, input
|
||||
|
||||
campaign, err := r.accessReview.StartCampaign(ctx, scope, input.AccessReviewCampaignID)
|
||||
if err != nil {
|
||||
if errors.Is(err, accessreview.ErrCampaignNoScopeSources) ||
|
||||
if errors.Is(err, accessreview.ErrCampaignNoSourcesSelected) ||
|
||||
errors.Is(err, accessreview.ErrCampaignNotDraft) {
|
||||
return nil, gqlutils.Invalid(ctx, err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user