We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 7931034 commit cd0a6c8Copy full SHA for cd0a6c8
1 file changed
main.go
@@ -404,6 +404,14 @@ func main() {
404
return
405
}
406
407
+
408
+ // Make sure vote is not empty
409
+ if len(vote.Options) == 0 {
410
+ c.JSON(http.StatusBadRequest, gin.H{"error": "You did not rank any options"})
411
+ return
412
+ }
413
414
+ // Submit Vote
415
database.CastRankedVote(c, &vote, &voter)
416
} else {
417
c.JSON(http.StatusInternalServerError, gin.H{"error": "Unknown Poll Type"})
0 commit comments