Add GCM consent types to version snapshot

Include gcm_consent_types in the published banner config
so the cookie banner SDK can read category-to-GCM mappings
from the config endpoint.

Signed-off-by: Émile Ré <emile@getprobo.com>
This commit is contained in:
Émile Ré
2026-04-24 13:41:48 +04:00
parent 2b15a1684c
commit 5112233925
2 changed files with 16 additions and 10 deletions

View File

@@ -348,12 +348,17 @@ func buildSnapshot(
if cookies == nil { if cookies == nil {
cookies = coredata.CookieItems{} cookies = coredata.CookieItems{}
} }
gcmConsentTypes := c.GCMConsentTypes
if gcmConsentTypes == nil {
gcmConsentTypes = []string{}
}
snapshotCategories[i] = coredata.CookieBannerVersionSnapshotCategory{ snapshotCategories[i] = coredata.CookieBannerVersionSnapshotCategory{
Name: c.Name, Name: c.Name,
Slug: c.Slug, Slug: c.Slug,
Description: c.Description, Description: c.Description,
Kind: c.Kind, Kind: c.Kind,
Cookies: cookies, Cookies: cookies,
GCMConsentTypes: gcmConsentTypes,
} }
} }

View File

@@ -49,11 +49,12 @@ type (
} }
CookieBannerVersionSnapshotCategory struct { CookieBannerVersionSnapshotCategory struct {
Name string `json:"name"` Name string `json:"name"`
Slug string `json:"slug"` Slug string `json:"slug"`
Description string `json:"description"` Description string `json:"description"`
Kind CookieCategoryKind `json:"kind"` Kind CookieCategoryKind `json:"kind"`
Cookies CookieItems `json:"cookies"` Cookies CookieItems `json:"cookies"`
GCMConsentTypes []string `json:"gcm_consent_types"`
} }
CookieBannerVersion struct { CookieBannerVersion struct {