From: Carl Worth Date: Thu, 11 Jun 2020 22:57:24 +0000 (-0700) Subject: Empathy: Change /judging endpoint to expect a top-level word_groups property X-Git-Url: https://git.cworth.org/git?p=lmno-server;a=commitdiff_plain;h=fa3bdc8a5207fc93f4d720771cb6155913f06262 Empathy: Change /judging endpoint to expect a top-level word_groups property It's probably wise, (for future-proofing our APIs), if the server looks for an explicitly-named property rather than just slurping up the whole request body. This also keeps the code more consistent with other endpoints, (which is going to be particularly important as I start refactoring things to remove some duplicated code). --- diff --git a/empathy.js b/empathy.js index 5635c77..7966d72 100644 --- a/empathy.js +++ b/empathy.js @@ -357,7 +357,7 @@ router.post('/judging/:prompt_id([0-9]+)', (request, response) => { const result = game.receive_judging(prompt_id, request.session.id, - request.body); + request.body.word_groups); response.json(result); if (game.state.players_judged >= game.players.length)