Add global branding config field to control cookie banner default

Introduces a BRANDING boolean config (default true) propagated through
the standard config pipeline. Cookie banners now initialize their
show_branding column from this config instead of hardcoding true.

Signed-off-by: Émile Ré <emile@getprobo.com>
This commit is contained in:
Émile Ré
2026-04-22 15:41:11 +04:00
parent 680e60b6e9
commit 4313930ae9
6 changed files with 21 additions and 5 deletions

View File

@@ -31,11 +31,12 @@ import (
)
type Service struct {
pg *pg.Client
pg *pg.Client
showBranding bool
}
func NewService(pgClient *pg.Client) *Service {
return &Service{pg: pgClient}
func NewService(pgClient *pg.Client, showBranding bool) *Service {
return &Service{pg: pgClient, showBranding: showBranding}
}
var defaultCategories = []struct {
@@ -413,7 +414,7 @@ func (s *Service) CreateCookieBanner(
PrivacyPolicyURL: req.PrivacyPolicyURL,
ConsentExpiryDays: req.ConsentExpiryDays,
ConsentMode: req.ConsentMode,
ShowBranding: true,
ShowBranding: s.showBranding,
CreatedAt: now,
UpdatedAt: now,
}