diff --git a/backend/src/routes/admin.js b/backend/src/routes/admin.js index 3c446c4..51bc2df 100644 --- a/backend/src/routes/admin.js +++ b/backend/src/routes/admin.js @@ -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); });