Schnellzugriff: Reihenfolge per Drag & Drop änderbar
This commit is contained in:
@@ -30,6 +30,14 @@ router.delete('/links/:id', authenticate, (req, res) => {
|
||||
res.json({ success: true });
|
||||
});
|
||||
|
||||
router.put('/links-order', authenticate, (req, res) => {
|
||||
const { ids } = req.body;
|
||||
if (!Array.isArray(ids)) return res.status(400).json({ error: 'ids erforderlich' });
|
||||
const update = db.prepare('UPDATE quick_links SET sort_order=? WHERE id=? AND user_id=?');
|
||||
db.transaction(() => { ids.forEach((id, i) => update.run(i, id, uid(req))); })();
|
||||
res.json({ ok: true });
|
||||
});
|
||||
|
||||
// ── Todos ─────────────────────────────────────────────────────────────────────
|
||||
router.get('/todos', authenticate, (req, res) => {
|
||||
res.json(db.prepare('SELECT * FROM todos WHERE user_id=? ORDER BY done,sort_order,id').all(uid(req)));
|
||||
|
||||
Reference in New Issue
Block a user