Add console GraphQL schema and resolvers for i18n
Add CookieBannerTranslation type, defaultLanguage field on CookieBanner, and upsert/delete mutations for managing per-language translations from the console. Signed-off-by: Émile Ré <emile@getprobo.com>
This commit is contained in:
@@ -64,6 +64,7 @@ type (
|
||||
PrivacyPolicyURL *string
|
||||
ConsentExpiryDays *int
|
||||
ConsentMode *coredata.CookieConsentMode
|
||||
DefaultLanguage *string
|
||||
}
|
||||
|
||||
UpdateCookieCategoryRequest struct {
|
||||
@@ -706,7 +707,7 @@ func (s *Service) UpdateCookieBanner(
|
||||
return fmt.Errorf("cannot load cookie banner: %w", err)
|
||||
}
|
||||
|
||||
consentChanged := req.PrivacyPolicyURL != nil || req.ConsentExpiryDays != nil || req.ConsentMode != nil
|
||||
consentChanged := req.PrivacyPolicyURL != nil || req.ConsentExpiryDays != nil || req.ConsentMode != nil || req.DefaultLanguage != nil
|
||||
|
||||
if req.Name != nil {
|
||||
banner.Name = *req.Name
|
||||
@@ -723,6 +724,9 @@ func (s *Service) UpdateCookieBanner(
|
||||
if req.ConsentMode != nil {
|
||||
banner.ConsentMode = *req.ConsentMode
|
||||
}
|
||||
if req.DefaultLanguage != nil {
|
||||
banner.DefaultLanguage = *req.DefaultLanguage
|
||||
}
|
||||
|
||||
banner.UpdatedAt = time.Now()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user