fix show_recurrent in embed list
This commit is contained in:
parent
8481524448
commit
c68e42ad32
2 changed files with 7 additions and 0 deletions
|
@ -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}`)
|
||||
|
|
|
@ -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'] },
|
||||
|
|
Loading…
Reference in a new issue