Added unit and api tests

This commit is contained in:
Brian McGonagill 2026-03-26 10:21:19 -05:00
parent 9f4204cc73
commit fedf1eb4c5
34 changed files with 9205 additions and 20 deletions

View file

@ -171,6 +171,9 @@ router.delete('/:id', auth_1.authenticate, async (req, res) => {
if (game.gameMasterId !== req.user.id) {
return res.status(403).json({ error: 'Not authorized' });
}
if (game.status !== 'DRAFT') {
return res.status(400).json({ error: 'Only draft games can be deleted' });
}
await index_1.prisma.game.delete({ where: { id } });
res.json({ message: 'Game deleted' });
}