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

@@ -2,7 +2,7 @@ const { Position } = require('../models');
const getAllPositions = async (req, res) => {
try {
const positions = await Position.findAll();
const positions = await Position.findAll({order: [['caption', 'ASC']]});
res.json(positions);
} catch (error) {
res.status(500).json({ error: 'Failed to fetch positions' });