From 5e949f3d30d3bd4737d425b944dd6355c6158b4a Mon Sep 17 00:00:00 2001 From: Zutatensuppe Date: Sat, 15 May 2021 11:06:37 +0200 Subject: [PATCH] fix new game going to bad url --- public/views/NewGame.vue.js | 2 +- server/index.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/public/views/NewGame.vue.js b/public/views/NewGame.vue.js index b4a50ca..ca55376 100644 --- a/public/views/NewGame.vue.js +++ b/public/views/NewGame.vue.js @@ -33,7 +33,7 @@ export default { }) if (res.status === 200) { const game = await res.json() - location.assign(game.url) + this.$router.push({ name: 'game', params: { id: game.id } }) } } } diff --git a/server/index.js b/server/index.js index a9ea1d1..f854cfe 100644 --- a/server/index.js +++ b/server/index.js @@ -104,7 +104,7 @@ app.post('/newgame', bodyParser.json(), async (req, res) => { req.body.scoreMode ) } - res.send({ url: `/g/${gameId}` }) + res.send({ id: gameId }) }) app.use('/common/', express.static(COMMON_DIR))