From 93da37dd3512f72a7bb4da44db410acd475d6288 Mon Sep 17 00:00:00 2001 From: "Torsten Schulz (local)" Date: Sun, 26 Apr 2026 23:28:00 +0200 Subject: [PATCH] Enhance worship filtering logic: Introduce legacy neighborhood configuration handling in WorshipRender component, allowing for backward compatibility with existing location parameters while ensuring neighborInvitation is set correctly for neighborhood pages. --- src/components/WorshipRender.vue | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/components/WorshipRender.vue b/src/components/WorshipRender.vue index c8774f0..2dfe0c8 100644 --- a/src/components/WorshipRender.vue +++ b/src/components/WorshipRender.vue @@ -95,12 +95,29 @@ export default { const params = { ...(this.config || {}) }; const currentPath = String(this.$route?.path || '').toLowerCase(); const isNeighborhoodPage = currentPath.includes('/worship/neighborhood') || currentPath.includes('/worship/neighbor'); + const isLegacyNeighborhoodConfig = (() => { + if (!params.location) return false; + try { + const list = Array.isArray(params.location) ? params.location : JSON.parse(params.location); + if (!Array.isArray(list)) return false; + const normalized = list.map((x) => Number(x)).sort((a, b) => a - b); + return normalized.length === 3 && normalized[0] === 13 && normalized[1] === 14 && normalized[2] === 15; + } catch (e) { + return false; + } + })(); if (isNeighborhoodPage) { // Für die Nachbarschaftsseite ist das Flag maßgeblich; // ein evtl. gesetzter Ortsfilter darf hier nicht blockieren. params.neighborInvitation = true; delete params.location; } + if (isLegacyNeighborhoodConfig) { + // Abwärtskompatibel für bestehende Seitenkonfigurationen in Inhalten/DB: + // location [13,14,15] bedeutete historisch "Nachbarschaftsraum". + params.neighborInvitation = true; + delete params.location; + } const response = await axios.get('/worships/filtered', { params });