Add scope source operation to access review n8n node
Campaigns cannot be started without at least one scope source, but the n8n node had no way to attach sources after creation. Expose the addAccessReviewCampaignSource mutation as an Add Source operation so workflows can configure sources before starting. Return INVALID instead of INTERNAL when start fails due to missing sources or invalid status, so n8n surfaces the real error message. Signed-off-by: Cursor Agent <cursoragent@cursor.com> Co-authored-by: Bryan FRIMIN <bryan@frimin.fr>
This commit is contained in:
@@ -9,6 +9,7 @@ import (
|
||||
"context"
|
||||
"errors"
|
||||
"fmt"
|
||||
"strings"
|
||||
|
||||
"github.com/vikstrous/dataloadgen"
|
||||
"go.gearno.de/kit/log"
|
||||
@@ -796,6 +797,10 @@ func (r *mutationResolver) StartAccessReviewCampaign(ctx context.Context, input
|
||||
|
||||
campaign, err := r.accessReview.StartCampaign(ctx, scope, input.AccessReviewCampaignID)
|
||||
if err != nil {
|
||||
if strings.HasPrefix(err.Error(), "cannot start campaign:") {
|
||||
return nil, gqlutils.Invalid(ctx, err)
|
||||
}
|
||||
|
||||
r.logger.ErrorCtx(ctx, "cannot start access review campaign", log.Error(err))
|
||||
|
||||
return nil, gqlutils.Internal(ctx)
|
||||
|
||||
Reference in New Issue
Block a user