Verified Commit 6fb73272 authored by les's avatar les
Browse files

fix filters on export

parent 6dfa77e5
......@@ -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 `<iframe style='border: 0px; width: 100%;' src="${this.settings.baseurl}/embed/list?${params.join('&')}"></iframe>`
},
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(',')}`)
}
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]}${query}`
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) {
......
......@@ -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))
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment