Verified Commit c68e42ad authored by les's avatar les
Browse files

fix show_recurrent in embed list

parent 84815244
......@@ -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'] },
......
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