activity feed
All checks were successful
Build Images and Deploy / Update-PROD-Stack (push) Successful in 30s

This commit is contained in:
2026-02-28 01:16:31 -05:00
parent bdb6d5ee25
commit b9981d0e70
3 changed files with 34 additions and 2 deletions

View File

@@ -329,6 +329,22 @@ const Scans = {
GROUP BY u.id
ORDER BY total_points DESC
`).all();
},
getRecentActivity(limit = 5) {
return db.prepare(`
SELECT s.points_awarded, s.scanned_at,
u.username,
p.card_number,
h.name as hunt_name, h.short_name as hunt_short_name, h.package_count
FROM scans s
JOIN users u ON s.user_id = u.id
JOIN packages p ON s.package_id = p.id
JOIN hunts h ON p.hunt_id = h.id
WHERE s.points_awarded > 0
ORDER BY s.scanned_at DESC
LIMIT ?
`).all(limit);
}
};