From 5cf6159d5b7ddbb4236e072f9795cc052de1478a Mon Sep 17 00:00:00 2001 From: AlecM33 Date: Thu, 21 Jul 2022 21:48:38 -0400 Subject: [PATCH] fix admin endpoint --- server/api/AdminAPI.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/server/api/AdminAPI.js b/server/api/AdminAPI.js index 05cb8bf..4854583 100644 --- a/server/api/AdminAPI.js +++ b/server/api/AdminAPI.js @@ -48,7 +48,11 @@ router.post('/sockets/broadcast', function (req, res) { }); router.get('/games/state', function (req, res) { - res.status(200).send(gameManager.activeGameRunner.activeGames); + const gamesArray = []; + for (const key of gameManager.activeGameRunner.activeGames.keys()) { + gamesArray.push(gameManager.activeGameRunner.activeGames.get(key)); + } + res.status(200).send(gamesArray); }); router.put('/games/state', function (req, res) {