store filters in app state
This commit is contained in:
@@ -456,7 +456,7 @@ const eventController = {
|
||||
const events = await Event.findAll({
|
||||
where,
|
||||
attributes: {
|
||||
exclude: ['slug', 'likes', 'boost', 'userId', 'is_visible', 'createdAt', 'updatedAt', 'placeId']
|
||||
exclude: ['slug', 'likes', 'boost', 'userId', 'is_visible', 'createdAt', 'updatedAt', 'placeId', 'description', 'resources']
|
||||
// include: [[Sequelize.fn('COUNT', Sequelize.col('activitypub_id')), 'ressources']]
|
||||
},
|
||||
order: ['start_datetime', [Tag, 'weigth', 'DESC']],
|
||||
@@ -465,6 +465,8 @@ const eventController = {
|
||||
{ model: Tag, attributes: ['tag'], required: !!tags, ...where_tags, through: { attributes: [] } },
|
||||
{ model: Place, required: false, attributes: ['id', 'name', 'address'] }
|
||||
]
|
||||
}).catch(e => {
|
||||
log.error(e)
|
||||
})
|
||||
|
||||
return events.map(e => {
|
||||
@@ -494,6 +496,7 @@ const eventController = {
|
||||
* Ensure we have the next instances of recurrent events
|
||||
*/
|
||||
_createRecurrentOccurrence (e) {
|
||||
log.debug(`Create recurrent event [${e.id}] ${e.title}"`)
|
||||
const event = {
|
||||
parentId: e.id,
|
||||
title: e.title,
|
||||
|
||||
@@ -110,8 +110,6 @@ api.post('/settings/logo', isAdmin, multer({ dest: config.upload_path }).single(
|
||||
api.put('/event/confirm/:event_id', hasPerm('event:write'), eventController.confirm)
|
||||
api.put('/event/unconfirm/:event_id', hasPerm('event:write'), eventController.unconfirm)
|
||||
|
||||
// import event
|
||||
|
||||
// get event
|
||||
api.get('/event/:event_id.:format?', cors, eventController.get)
|
||||
|
||||
@@ -119,7 +117,6 @@ api.get('/event/:event_id.:format?', cors, eventController.get)
|
||||
api.get('/export/:type', cors, exportController.export)
|
||||
|
||||
// get events in this range
|
||||
// api.get('/event/:month/:year', cors, eventController.getAll)
|
||||
api.get('/events', cors, eventController.select)
|
||||
|
||||
api.get('/instances', isAdmin, instanceController.getAll)
|
||||
@@ -136,6 +133,7 @@ api.post('/announcements', isAdmin, announceController.add)
|
||||
api.put('/announcements/:announce_id', isAdmin, announceController.update)
|
||||
api.delete('/announcements/:announce_id', isAdmin, announceController.remove)
|
||||
|
||||
// OAUTH
|
||||
api.get('/clients', hasPerm('oauth:read'), oauthController.getClients)
|
||||
api.get('/client/:client_id', hasPerm('oauth:read'), oauthController.getClient)
|
||||
api.post('/client', oauthController.createClient)
|
||||
|
||||
Reference in New Issue
Block a user