use req.params directly
This commit is contained in:
@@ -19,7 +19,7 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"@chessu/types": "*",
|
||||
"@types/node": "18.14.4",
|
||||
"@types/node": "18.14.6",
|
||||
"@types/react": "18.0.28",
|
||||
"@types/react-dom": "18.0.11",
|
||||
"autoprefixer": "^10.4.13",
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
"eslint-config-next": "13.2.3",
|
||||
"eslint-config-prettier": "^8.6.0",
|
||||
"prettier": "^2.8.4",
|
||||
"prettier-plugin-tailwindcss": "^0.2.3"
|
||||
"prettier-plugin-tailwindcss": "^0.2.4"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=18"
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
"@types/connect-pg-simple": "^7.0.0",
|
||||
"@types/express": "^4.17.17",
|
||||
"@types/express-session": "^1.17.6",
|
||||
"@types/node": "^18.14.4",
|
||||
"@types/node": "^18.14.6",
|
||||
"@types/pg": "^8.6.6",
|
||||
"ts-node": "^10.9.1",
|
||||
"typescript": "^4.9.5"
|
||||
|
||||
@@ -19,10 +19,7 @@ export const getActiveGame = async (req: Request, res: Response) => {
|
||||
return;
|
||||
}
|
||||
|
||||
const code = req.params.code;
|
||||
|
||||
console.log(code);
|
||||
const game = activeGames.find((g) => g.code === code);
|
||||
const game = activeGames.find((g) => g.code === req.params.code);
|
||||
|
||||
if (!game) {
|
||||
res.status(404).end();
|
||||
|
||||
Reference in New Issue
Block a user