[pl][census] fixes

This commit is contained in:
Andrea 2022-02-17 17:00:57 +01:00
parent 1bc3e224ed
commit a52475f644
2 changed files with 10 additions and 5 deletions

View File

@ -20,8 +20,8 @@
<ol>
<li v-for="(question, i) in config.census.questions">
<p>{{question.question}}</p>
<p><strong>{{queue.next.answers[i.toString()]}}</strong></p>
<p v-if="queue.next.writins[i.toString()]"><strong><em>{{queue.next.writins[i.toString()]}}</em></strong></p>
<p v-if="queue.next.answers[i.toString()]" :class="question.type === 'textarea' ? 'bg-primary text-white p-2 rounded' : ''"><strong>{{queue.next.answers[i.toString()]}}</strong></p>
<p v-if="queue.next.writins[i.toString()]" class="bg-primary text-white p-2 rounded"><strong><em>{{queue.next.writins[i.toString()]}}</em></strong></p>
</li>
</ol>

View File

@ -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