summaryrefslogtreecommitdiff
path: root/controllers/games/root.js
diff options
context:
space:
mode:
authorJulien Dessaux2023-01-05 02:09:07 +0100
committerJulien Dessaux2023-01-05 02:09:07 +0100
commitd7ed1196bdd44d7734d41d91a5e72a71785e0a08 (patch)
treeaafae6571d5154dc5e9a061c8f54ca8e9b1287ad /controllers/games/root.js
parentAdded more tests (diff)
downloadjeux-de-mots-d7ed1196bdd44d7734d41d91a5e72a71785e0a08.tar.gz
jeux-de-mots-d7ed1196bdd44d7734d41d91a5e72a71785e0a08.tar.bz2
jeux-de-mots-d7ed1196bdd44d7734d41d91a5e72a71785e0a08.zip
switched to single quotes string in eslint
Diffstat (limited to '')
-rw-r--r--controllers/games/root.js22
1 files changed, 11 insertions, 11 deletions
diff --git a/controllers/games/root.js b/controllers/games/root.js
index 4a4e80d..8b6fc22 100644
--- a/controllers/games/root.js
+++ b/controllers/games/root.js
@@ -1,17 +1,17 @@
-import { validationResult } from "express-validator";
+import { validationResult } from 'express-validator';
-import { getUserByUsername } from "../../database/users.js";
-import { listGames, newGame } from "../../database/games.js";
-import { emptyBoard, Bag } from "../../utils/board.js";
+import { getUserByUsername } from '../../database/users.js';
+import { listGames, newGame } from '../../database/games.js';
+import { emptyBoard, Bag } from '../../utils/board.js';
function makePageData(user) {
return {
- title: "Parties",
+ title: 'Parties',
user: user,
games: listGames(user.id),
formdata: {
- name: "",
- username: "",
+ name: '',
+ username: '',
},
errors: {},
};
@@ -20,7 +20,7 @@ function makePageData(user) {
export function root_get(req, res) {
let page = makePageData(req.session.user);
page.games.forEach(g => g.data = JSON.parse(g.data));
- return res.render("games", page);
+ return res.render('games', page);
}
function makeNewGameData(name, player1, player2) {
@@ -54,11 +54,11 @@ export function root_post(req, res) {
if (gameId) {
return res.redirect(302, `/games/${gameId}`);
} else {
- page.errors.mismatch = "Erreur du serveur: la création de partie a échoué";
+ page.errors.mismatch = 'Erreur du serveur: la création de partie a échoué';
}
} else {
- page.errors.username = { msg: "L'identifiant n'existe pas." };
+ page.errors.username = { msg: 'L\'identifiant n\'existe pas.' };
}
}
- return res.render("games", page);
+ return res.render('games', page);
}