summaryrefslogtreecommitdiff
path: root/controllers/games/root.js
blob: ece7b74cbf826bb7747aebba144c5d1a4f29b5e4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
import { listGames } from "../../database/games.js";

export function root_get(req, res) {
	const data = {
		title: "Liste des parties",
		user: req.session.user,
		games: listGames(req.session.user.id),
	};
	for (let i=0; i<data.games.length; i++) {
		data.games[i].data = JSON.parse(data.games[i].data);
	}
	return res.render("games", data);
}