Fix alias resolver, field blur, and sitemap URLs

The audit alias resolver returned raw service errors. Log them
and return gqlutils.Internal like other resolvers in the file.

Remove-only users could edit the alias field to a new value that
was never saved. Reset local state when set permission is missing,
and catch mutation rejections on blur.

Sitemap generation appended audit report file IDs without
deduplication, which could emit duplicate document URLs when
multiple audits share the same report file.

Signed-off-by: Bryan Frimin <bryan@probo.com>
This commit is contained in:
Bryan Frimin
2026-06-22 09:08:14 +02:00
parent 9a56311d60
commit 92b1264603
3 changed files with 46 additions and 25 deletions

View File

@@ -180,7 +180,13 @@ func (r *auditResolver) Alias(ctx context.Context, obj *types.Audit) (*string, e
return nil, err
}
return r.probo.TrustCenterAliases.GetByResourceID(ctx, scope, obj.ID)
alias, err := r.probo.TrustCenterAliases.GetByResourceID(ctx, scope, obj.ID)
if err != nil {
r.logger.ErrorCtx(ctx, "cannot get audit alias", log.Error(err))
return nil, gqlutils.Internal(ctx)
}
return alias, nil
}
// Permission is the resolver for the permission field.