It never ceases to amaze me the bugs that can only be found when
writing tests. (My manual client testing missed this bug because they
never looked for this ID, but instead picked up the ID from the
broadcast to all clients when a new prompt is added.)
router.post('/prompts', (request, response) => {
const game = request.game;
router.post('/prompts', (request, response) => {
const game = request.game;
- game.add_prompt(request.body.items, request.body.prompt);
+ prompt = game.add_prompt(request.body.items, request.body.prompt);
+
+ response.json({ id: prompt.id});
});
router.post('/vote/:prompt_id([0-9]+)', (request, response) => {
});
router.post('/vote/:prompt_id([0-9]+)', (request, response) => {