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 {
cookies = coredata.CookieItems{}
}
gcmConsentTypes := c.GCMConsentTypes
if gcmConsentTypes == nil {
gcmConsentTypes = []string{}
}
snapshotCategories[i] = coredata.CookieBannerVersionSnapshotCategory{
Name: c.Name,
Slug: c.Slug,
Description: c.Description,
Kind: c.Kind,
Cookies: cookies,
Name: c.Name,
Slug: c.Slug,
Description: c.Description,
Kind: c.Kind,
Cookies: cookies,
GCMConsentTypes: gcmConsentTypes,
}
}

View File

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