fix show_recurrent in embed list
This commit is contained in:
@@ -11,10 +11,12 @@ export default {
|
|||||||
const title = query.title
|
const title = query.title
|
||||||
const tags = query.tags
|
const tags = query.tags
|
||||||
const places = query.places
|
const places = query.places
|
||||||
|
const show_recurrent = !!query.show_recurrent
|
||||||
|
|
||||||
let params = []
|
let params = []
|
||||||
if (places) { params.push(`places=${places}`) }
|
if (places) { params.push(`places=${places}`) }
|
||||||
if (tags) { params.push(`tags=${tags}`) }
|
if (tags) { params.push(`tags=${tags}`) }
|
||||||
|
if (show_recurrent) { params.push('show_recurrent=1') }
|
||||||
|
|
||||||
params = params.length ? `?${params.join('&')}` : ''
|
params = params.length ? `?${params.join('&')}` : ''
|
||||||
const events = await $axios.$get(`/export/json${params}`)
|
const events = await $axios.$get(`/export/json${params}`)
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ const exportController = {
|
|||||||
const type = req.params.type
|
const type = req.params.type
|
||||||
const tags = req.query.tags
|
const tags = req.query.tags
|
||||||
const places = req.query.places
|
const places = req.query.places
|
||||||
|
const show_recurrent = !!req.query.show_recurrent
|
||||||
|
|
||||||
const where = {}
|
const where = {}
|
||||||
const yesterday = moment().subtract('1', 'day').unix()
|
const yesterday = moment().subtract('1', 'day').unix()
|
||||||
@@ -25,6 +26,10 @@ const exportController = {
|
|||||||
where.placeId = places.split(',')
|
where.placeId = places.split(',')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!show_recurrent) {
|
||||||
|
where.parentId = null
|
||||||
|
}
|
||||||
|
|
||||||
const events = await Event.findAll({
|
const events = await Event.findAll({
|
||||||
order: ['start_datetime'],
|
order: ['start_datetime'],
|
||||||
attributes: { exclude: ['is_visible', 'recurrent', 'createdAt', 'likes', 'boost', 'userId', 'placeId'] },
|
attributes: { exclude: ['is_visible', 'recurrent', 'createdAt', 'likes', 'boost', 'userId', 'placeId'] },
|
||||||
|
|||||||
Reference in New Issue
Block a user