]> git.cworth.org Git - lmno-server/commitdiff
Empathy: Change /judging endpoint to expect a top-level word_groups property
authorCarl Worth <cworth@cworth.org>
Thu, 11 Jun 2020 22:57:24 +0000 (15:57 -0700)
committerCarl Worth <cworth@cworth.org>
Thu, 11 Jun 2020 22:57:24 +0000 (15:57 -0700)
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).

empathy.js

index 5635c774f18e9fc8d64036df05cdc788b4c19907..7966d72db185bf4846a83c3b811cb3d457c88d27 100644 (file)
@@ -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)