Dateien nach "backend/src/routes" hochladen

This commit is contained in:
2026-05-26 15:37:47 +02:00
parent 7ec5af740a
commit c8b327e457

View File

@@ -37,8 +37,11 @@ router.get('/users', authenticate, requireAdmin, (req, res) => {
const bestellung = db.prepare('SELECT COUNT(*) c FROM orders WHERE user_id=?').get(u.id).c;
const todos = db.prepare('SELECT COUNT(*) c FROM todos WHERE user_id=?').get(u.id).c;
const links = db.prepare('SELECT COUNT(*) c FROM quick_links WHERE user_id=?').get(u.id).c;
const files = db.prepare('SELECT COUNT(*) c FROM files WHERE user_id=?').get(u.id).c;
const noteLen = (db.prepare('SELECT content FROM notes WHERE user_id=?').get(u.id)?.content || '').length;
return { ...u, archiv, bestellung, todos, links, noteLen };
// iCals are stored in localStorage per user - not in DB, so we can't count them server-side
const icals = 0;
return { ...u, archiv, bestellung, todos, links, files, icals, noteLen };
});
res.json(stats);
});