Added order

This commit is contained in:
Torsten Schulz
2024-07-10 17:48:40 +02:00
parent 7ab3be1465
commit d4811660fe
9 changed files with 15 additions and 12 deletions

View File

@@ -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 });
}