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:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user