Added order
This commit is contained in:
@@ -10,7 +10,8 @@ const getAllEvents = async (req, res) => {
|
||||
{ model: EventPlace, as: 'eventPlace' },
|
||||
{ model: EventType, as: 'eventType' },
|
||||
{ model: ContactPerson, as: 'contactPersons', through: { attributes: [] } }
|
||||
]
|
||||
],
|
||||
order: ['name', 'date', 'time']
|
||||
});
|
||||
res.json(events);
|
||||
} catch (error) {
|
||||
@@ -62,6 +63,7 @@ const filterEvents = async (req, res) => {
|
||||
{ model: EventType, as: 'eventType' },
|
||||
{ model: ContactPerson, as: 'contactPersons', through: { attributes: [] } }
|
||||
],
|
||||
order: ['name', 'date', 'time']
|
||||
});
|
||||
return res.json({ events });
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user