Skip to content

Fix for #85 - Sending BadRequest error when getBallots is called with ballotVisibility hidden

This solves the issue mentioned in #85 (closed)

I've added a if else to check whether the ballotVisibility is set to hidden

if(ballotVisibility != 'hidden')
respond with ballots array
else
respond with BadRequest error message -> "Ballots are kept hidden for this election"

Here's the screenshot of response. Screenshot__275_

I've tested this code under two conditions.

  1. When ballotVisibility is visible or public where it returns with ballots array with ballots information
  2. When ballotVisibility is hidden where it returns with BadRequest error message -> "Ballots are kept hidden for this election" as shown in the screenshot above

Merge request reports