color, weigth, locale, config

This commit is contained in:
lesion
2019-06-26 14:44:21 +02:00
parent b093dae3f3
commit 1087723be8
27 changed files with 188 additions and 86 deletions

View File

@@ -9,26 +9,25 @@ const exportController = {
const type = req.params.type
const tags = req.query.tags
const places = req.query.places
const whereTag = {}
const wherePlace = {}
const yesterday = moment().subtract('1', 'day')
const where = {}
const yesterday = moment().subtract('1', 'day').unix()
if (tags) {
whereTag.tag = tags.split(',')
where.tag = tags.split(',')
}
if (places) {
wherePlace.id = places.split(',')
where.placeId = places.split(',')
}
const events = await Event.findAll({
order: ['start_datetime'],
where: {
is_visible: true,
start_datetime: { [Op.gte]: yesterday },
placeId: places.split(',')
...where
},
attributes: {
exclude: ['createdAt', 'updatedAt']
},
include: [{ model: Place, attributes: ['name', 'id', 'address', 'weigth'] }]
include: [{ model: Place, attributes: ['name', 'id', 'address'] }]
})
switch (type) {
case 'feed':