mirror of
https://framagit.org/les/gancio.git
synced 2025-02-01 00:52:01 +01:00
fix tags/places filters
This commit is contained in:
parent
4e28423688
commit
ef65d3f9dd
2 changed files with 26 additions and 8 deletions
|
@ -504,13 +504,21 @@ const eventController = {
|
|||
where.start_datetime = { [Op.lte]: end }
|
||||
}
|
||||
|
||||
if (places || tags) {
|
||||
if (tags && places) {
|
||||
where[Op.or] = {
|
||||
placeId: places ? places.split(',') : [],
|
||||
'$tags.tag$': tags ? tags.split(',') : []
|
||||
'$tags.tag$': tags.split(',')
|
||||
}
|
||||
}
|
||||
|
||||
if (tags) {
|
||||
where['$tags.tag$'] = tags.split(',')
|
||||
}
|
||||
|
||||
if (places) {
|
||||
where.placeId = places.split(',')
|
||||
}
|
||||
|
||||
const events = await Event.findAll({
|
||||
where,
|
||||
attributes: {
|
||||
|
|
|
@ -17,12 +17,22 @@ const exportController = {
|
|||
const where = {}
|
||||
const yesterday = moment().subtract('1', 'day').unix()
|
||||
|
||||
if (places || tags) {
|
||||
|
||||
if (tags && places) {
|
||||
where[Op.or] = {
|
||||
placeId: places ? places.split(',') : [],
|
||||
'$tags.tag$': tags ? tags.split(',') : []
|
||||
'$tags.tag$': tags.split(',')
|
||||
}
|
||||
}
|
||||
|
||||
if (tags) {
|
||||
where['$tags.tag$'] = tags.split(',')
|
||||
}
|
||||
|
||||
if (places) {
|
||||
where.placeId = places.split(',')
|
||||
}
|
||||
|
||||
if (!show_recurrent) {
|
||||
where.parentId = null
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue