Rename categories to consentCategories

Exclude the UNCATEGORISED category at the SQL level so
the admin cookie/display/translations pages only see
consent-relevant categories. Removes dead client-side
UNCATEGORISED filters that are no longer needed.

Signed-off-by: Émile Ré <emile@getprobo.com>
This commit is contained in:
Émile Ré
2026-05-04 19:51:22 +04:00
parent 3254c6ddec
commit c26b9c0abe
10 changed files with 113 additions and 27 deletions

View File

@@ -428,7 +428,7 @@ func (s *Service) ensureDraftVersionForBanner(
}
var categories coredata.CookieCategories
if err := categories.LoadConsentCategoriesByCookieBannerID(ctx, tx, scope, bannerID); err != nil {
if err := categories.LoadAllConsentCategoriesByCookieBannerID(ctx, tx, scope, bannerID); err != nil {
return nil, fmt.Errorf("cannot load cookie categories: %w", err)
}
@@ -1078,7 +1078,7 @@ func (s *Service) ListCookieCategoriesForBanner(
err := s.pg.WithConn(
ctx,
func(ctx context.Context, conn pg.Querier) error {
if err := categories.LoadByCookieBannerID(ctx, conn, scope, bannerID, cursor); err != nil {
if err := categories.LoadConsentCategoriesByCookieBannerID(ctx, conn, scope, bannerID, cursor); err != nil {
return fmt.Errorf("cannot list cookie categories: %w", err)
}
@@ -1105,7 +1105,7 @@ func (s *Service) CountCookieCategoriesForBanner(
var categories coredata.CookieCategories
var err error
count, err = categories.CountByCookieBannerID(ctx, conn, scope, bannerID)
count, err = categories.CountConsentCategoriesByCookieBannerID(ctx, conn, scope, bannerID)
if err != nil {
return fmt.Errorf("cannot count cookie categories: %w", err)
}
@@ -1943,7 +1943,7 @@ func (s *Service) GetActiveBannerConfig(
}
var categories coredata.CookieCategories
if err := categories.LoadConsentCategoriesByCookieBannerID(ctx, conn, scope, banner.ID); err != nil {
if err := categories.LoadAllConsentCategoriesByCookieBannerID(ctx, conn, scope, banner.ID); err != nil {
return fmt.Errorf("cannot load cookie categories: %w", err)
}