diff --git a/frontend/src/utils/falukantHouseModels.js b/frontend/src/utils/falukantHouseModels.js index 10ef3e7..2a625b3 100644 --- a/frontend/src/utils/falukantHouseModels.js +++ b/frontend/src/utils/falukantHouseModels.js @@ -1,4 +1,4 @@ -const HOUSE_MODELS = Object.freeze({ +const LEGACY_HOUSE_MODELS = Object.freeze({ 'Unter der Brücke': 'under_bridge', 'Strohhütte': 'straw_hut', Holzhaus: 'wooden_house', @@ -10,6 +10,11 @@ const HOUSE_MODELS = Object.freeze({ Schloss: 'castle', }); +const MODEL_NAMES = new Set(Object.values(LEGACY_HOUSE_MODELS)); + export function getFalukantHouseModel(houseType) { - return HOUSE_MODELS[houseType?.labelTr] || 'under_bridge'; + // HouseType.labelTr is the stable database key (e.g. "wooden_house"), + // while older data may still contain the German display label. + const key = houseType?.abbr || houseType?.labelTr; + return MODEL_NAMES.has(key) ? key : (LEGACY_HOUSE_MODELS[key] || 'under_bridge'); } diff --git a/frontend/src/views/falukant/HouseView.vue b/frontend/src/views/falukant/HouseView.vue index 8eccb66..ac765d9 100755 --- a/frontend/src/views/falukant/HouseView.vue +++ b/frontend/src/views/falukant/HouseView.vue @@ -133,7 +133,12 @@

{{ $t('falukant.house.buyablehouses') }}

- +

{{ $t(`falukant.house.type.${house.houseType.labelTr}`) }}

@@ -594,16 +599,6 @@ h2 { border-radius: 4px; } -.house-preview--static { - display: grid; - place-items: center; - color: #75553d; - background: linear-gradient(145deg, #f6ecd9, #dbc19a); - border: 1px solid rgba(117, 85, 61, 0.25); - font-size: 4rem; - line-height: 1; -} - .house-info { width: 100%; display: flex;