fix show_recurrent in embed list

This commit is contained in:
les 2021-07-27 22:01:34 +02:00
parent 8481524448
commit c68e42ad32
No known key found for this signature in database
GPG key ID: 352918250B012177
2 changed files with 7 additions and 0 deletions

View file

@ -11,10 +11,12 @@ export default {
const title = query.title
const tags = query.tags
const places = query.places
const show_recurrent = !!query.show_recurrent
let params = []
if (places) { params.push(`places=${places}`) }
if (tags) { params.push(`tags=${tags}`) }
if (show_recurrent) { params.push('show_recurrent=1') }
params = params.length ? `?${params.join('&')}` : ''
const events = await $axios.$get(`/export/json${params}`)

View file

@ -12,6 +12,7 @@ const exportController = {
const type = req.params.type
const tags = req.query.tags
const places = req.query.places
const show_recurrent = !!req.query.show_recurrent
const where = {}
const yesterday = moment().subtract('1', 'day').unix()
@ -25,6 +26,10 @@ const exportController = {
where.placeId = places.split(',')
}
if (!show_recurrent) {
where.parentId = null
}
const events = await Event.findAll({
order: ['start_datetime'],
attributes: { exclude: ['is_visible', 'recurrent', 'createdAt', 'likes', 'boost', 'userId', 'placeId'] },