Enhance worship filtering logic: Modify fetchWorships method to conditionally include neighborInvitation parameter for neighborhood pages, ensuring location filters do not interfere with neighborhood-specific worship retrieval.

This commit is contained in:
Torsten Schulz (local)
2026-04-14 11:54:16 +02:00
parent 6e30f739a6
commit 64d6c3e6b4

View File

@@ -92,8 +92,17 @@ export default {
formatDate,
async fetchWorships() {
try {
const params = { ...(this.config || {}) };
const currentPath = String(this.$route?.path || '').toLowerCase();
const isNeighborhoodPage = currentPath.includes('/worship/neighborhood') || currentPath.includes('/worship/neighbor');
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;
}
const response = await axios.get('/worships/filtered', {
params: this.config
params
});
this.worships = response.data;
} catch (error) {