feat(score): Added a scoring system to log 10 last victories
This commit is contained in:
@@ -32,6 +32,7 @@ import {
|
||||
checkTeamVisibility,
|
||||
insertTeamVisibility,
|
||||
getTeamVisibleCells,
|
||||
getRoundHistory,
|
||||
} from "../db/gameDb.js";
|
||||
import {
|
||||
nextResetUtc,
|
||||
@@ -553,4 +554,15 @@ router.get("/cell/attacks", async (req, res) => {
|
||||
}
|
||||
});
|
||||
|
||||
// GET /api/round-history
|
||||
router.get("/round-history", async (_req, res) => {
|
||||
try {
|
||||
const history = await getRoundHistory(10);
|
||||
res.json(history);
|
||||
} catch (e) {
|
||||
console.error(e);
|
||||
res.status(500).json({ error: "database_error" });
|
||||
}
|
||||
});
|
||||
|
||||
export default router;
|
||||
Reference in New Issue
Block a user