From a52475f644154fb227aefb4bcec790ccdd43b545 Mon Sep 17 00:00:00 2001 From: Andrea Date: Thu, 17 Feb 2022 17:00:57 +0100 Subject: [PATCH] [pl][census] fixes --- routes/censusModeration.vue | 4 ++-- server/routes/census.js | 11 ++++++++--- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/routes/censusModeration.vue b/routes/censusModeration.vue index 8b9c0578..64480223 100644 --- a/routes/censusModeration.vue +++ b/routes/censusModeration.vue @@ -20,8 +20,8 @@
  1. {{question.question}}

    -

    {{queue.next.answers[i.toString()]}}

    -

    {{queue.next.writins[i.toString()]}}

    +

    {{queue.next.answers[i.toString()]}}

    +

    {{queue.next.writins[i.toString()]}}

diff --git a/server/routes/census.js b/server/routes/census.js index 87e3cd38..7aaa4e4e 100644 --- a/server/routes/census.js +++ b/server/routes/census.js @@ -69,9 +69,14 @@ router.post('/census/submit', handleErrorAsync(async (req, res) => { })); router.get('/census/count', handleErrorAsync(async (req, res) => { - // if (!req.isGranted('census')) { - // return res.status(401).json({error: 'Unauthorised'}); - // } + if (!req.isGranted('census')) { + return res.json({ + all: 0, + nonbinary: 0, + usable: 0, + awaiting: 0, + }); + } // duplication reason: https://github.com/felixfbecker/node-sql-template-strings/issues/71