From 440e8cd540ec12dd7858bb06df83f46def5be3c7 Mon Sep 17 00:00:00 2001 From: Nathaniel Tampus Date: Mon, 6 Mar 2023 18:43:50 +0800 Subject: [PATCH] exclude ended games from public api --- server/src/controllers/games.controller.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/src/controllers/games.controller.ts b/server/src/controllers/games.controller.ts index fcec918..3c57013 100644 --- a/server/src/controllers/games.controller.ts +++ b/server/src/controllers/games.controller.ts @@ -5,7 +5,7 @@ import { nanoid } from "nanoid"; export const getActivePublicGames = async (req: Request, res: Response) => { try { - res.status(200).json(activeGames.filter((g) => !g.unlisted)); + res.status(200).json(activeGames.filter((g) => !g.unlisted && !g.winner)); } catch (err: unknown) { console.log(err); res.status(500).end();