Fix some lint error + change error handling

Signed-off-by: Émile Ré <emile@getprobo.com>
This commit is contained in:
Émile Ré
2026-04-21 11:06:54 +04:00
parent d3333fd137
commit 937a0079fc
3 changed files with 5 additions and 7 deletions

View File

@@ -522,11 +522,8 @@ func (r *mutationResolver) MoveCookieToCategory(ctx context.Context, input types
return nil, err
}
scope := coredata.NewScopeFromObjectID(input.SourceCookieCategoryID)
result, err := r.cookieBanner.MoveCookieToCategory(
ctx,
scope,
cookiebanner.MoveCookieToCategoryRequest{
SourceCookieCategoryID: input.SourceCookieCategoryID,
TargetCookieCategoryID: input.TargetCookieCategoryID,
@@ -540,7 +537,7 @@ func (r *mutationResolver) MoveCookieToCategory(ctx context.Context, input types
case errors.Is(err, cookiebanner.ErrCookieNotFound):
return nil, gqlutils.NotFound(ctx, err)
case errors.Is(err, cookiebanner.ErrCategoriesBannerMismatch):
return nil, gqlutils.Invalidf(ctx, "source and target categories must belong to the same banner")
return nil, gqlutils.NotFoundf(ctx, "source or target category not found")
default:
if validationErrors, ok := errors.AsType[validator.ValidationErrors](err); ok {
return nil, gqlutils.InvalidValidationErrors(ctx, validationErrors)