fix: sync header_style DB column with theme editor selections (#158)

The frontend never sent header_style/hero_divider_style as separate
fields when creating or updating events, so the database columns always
kept their default value of 'standard' — making the hero header
impossible to enable through the admin UI.

- Extract headerStyle/heroDividerStyle from theme config and include in
  create and update payloads (CreateEventPage, EventDetailsPage)
- Add backend fallback to extract values from color_theme JSON when not
  explicitly provided, ensuring older clients stay in sync
This commit is contained in:
Paul Nothaft
2026-02-03 17:12:56 +01:00
parent 6c30e2c2ed
commit a19e7c40a2
4 changed files with 56 additions and 2 deletions
@@ -292,6 +292,8 @@ export const CreateEventPage: React.FC = () => {
password: formData.require_password ? formData.password : undefined,
welcome_message: formData.welcome_message || '',
color_theme: JSON.stringify(formData.theme_config),
header_style: formData.theme_config.headerStyle || 'standard',
hero_divider_style: formData.theme_config.heroDividerStyle || 'wave',
expiration_days: requireExpiration ? formData.expires_in_days : undefined,
allow_user_uploads: formData.allow_user_uploads,
upload_category_id: formData.upload_category_id,
@@ -550,6 +550,9 @@ export const EventDetailsPage: React.FC = () => {
hero_logo_position: editForm.hero_logo_position,
// Hero image anchor position (#162)
hero_image_anchor: editForm.hero_image_anchor,
// Header style settings (decoupled from layout, #158)
header_style: currentTheme?.headerStyle || 'standard',
hero_divider_style: currentTheme?.heroDividerStyle || 'wave',
};
// Only include fields that have defined values