diff --git a/pages/export.vue b/pages/export.vue index fc7e2561..785707e1 100644 --- a/pages/export.vue +++ b/pages/export.vue @@ -125,27 +125,31 @@ export default { } if (this.filters.tags.length) { - params.push(`tags=${this.filters.tags.map(t => t.id)}`) + params.push(`tags=${this.filters.tags.join(',')}`) } + if (this.filters.show_recurrent) { + params.push('show_recurrent=true') + } return `` }, link () { const typeMap = ['rss', 'ics', 'list'] - const tags = this.filters.tags.join(',') - const places = this.filters.places.join(',') - let query = '' - if (tags || places) { - query = '?' - if (tags) { - query += 'tags=' + tags - if (places) { query += '&places=' + places } - } else { - query += 'places=' + places - } + const params = [] + + if (this.filters.tags.length) { + params.push(`tags=${this.filters.tags.join(',')}`) } - return `${this.settings.baseurl}/feed/${typeMap[this.type]}${query}` + if (this.filters.places.length) { + params.push(`places=${this.filters.places.join(',')}`) + } + + if (this.filters.show_recurrent) { + params.push('show_recurrent=true') + } + + return `${this.settings.baseurl}/feed/${typeMap[this.type]}?${params.join('&')}` }, showLink () { return (['rss', 'ics'].includes(this.type)) @@ -158,7 +162,7 @@ export default { start: dayjs().unix(), places: this.filters.places, tags: this.filters.tags, - show_recurrent: this.filters.show_recurrent + show_recurrent: !!this.filters.show_recurrent }) }, copyLink (type) { diff --git a/plugins/api.js b/plugins/api.js index d1b5959b..c81179a2 100644 --- a/plugins/api.js +++ b/plugins/api.js @@ -22,7 +22,7 @@ export default ({ $axios, store }, inject) => { end: params.end, places: params.places && params.places.join(','), tags: params.tags && params.tags.join(','), - show_recurrent: params.show_recurrent + show_recurrent: !!params.show_recurrent } }) return events.map(e => Object.freeze(e))