Fixed Worship order

This commit is contained in:
Torsten Schulz
2024-09-06 23:39:02 +02:00
parent 5c6cfa41ab
commit 8066bedb30

View File

@@ -36,7 +36,8 @@ exports.getAllWorships = async (req, res) => {
}, },
attributes: authorized ? undefined : { exclude: ['sacristanService'] }, attributes: authorized ? undefined : { exclude: ['sacristanService'] },
order: [ order: [
['date', 'DESC'] ['date', 'ASC'],
['time', 'ASC']
], ],
}); });
res.status(200).json(worships); res.status(200).json(worships);
@@ -108,7 +109,10 @@ exports.getFilteredWorships = async (req, res) => {
model: EventPlace, model: EventPlace,
as: 'eventPlace', as: 'eventPlace',
}, },
order: [order.split(' ')], order: [
['date', 'ASC'],
['time', 'ASC']
],
}); });
res.status(200).json(worships); res.status(200).json(worships);
} catch (error) { } catch (error) {