fix: event exports when collection_in_home and tags or places are selected

This commit is contained in:
lesion 2024-01-08 00:00:37 +01:00
parent 90deb79d6b
commit f160430625
No known key found for this signature in database
GPG key ID: 352918250B012177

View file

@ -728,23 +728,24 @@ const eventController = {
const older = req.query.older || false const older = req.query.older || false
const show_multidate = settings.allow_multidate_event && helpers.queryParamToBool(req.query.show_multidate, true) const show_multidate = settings.allow_multidate_event && helpers.queryParamToBool(req.query.show_multidate, true)
// typeof req.query.show_multidate !== 'undefined' ? req.query.show_multidate !== 'false' : true
const show_recurrent = settings.allow_recurrent_event && helpers.queryParamToBool(req.query.show_recurrent, settings.recurrent_event_visible) const show_recurrent = settings.allow_recurrent_event && helpers.queryParamToBool(req.query.show_recurrent, settings.recurrent_event_visible)
// typeof req.query.show_recurrent !== 'undefined' ? req.query.show_recurrent === 'true' : settings.recurrent_event_visible
if (settings.collection_in_home) { let events = []
return res.json(await collectionController._getEvents({ if (settings.collection_in_home && !(tags || places)) {
events = await collectionController._getEvents({
name: settings.collection_in_home, name: settings.collection_in_home,
start, start,
end, end,
limit limit
})) })
} else { } else {
return res.json(await eventController._select({ events = await eventController._select({
start, end, query, places, tags, show_recurrent, show_multidate, limit, page, older start, end, query, places, tags, show_recurrent, show_multidate, limit, page, older
})) })
} }
return res.json(events)
}, },
/** /**