We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 1ae91b6 commit 63936c1Copy full SHA for 63936c1
1 file changed
api.go
@@ -254,14 +254,21 @@ func GetPollResults(c *gin.Context) {
254
return
255
}
256
257
- fmt.Println(len(results))
+ numVotes := 0
258
+
259
+ for _, v := range results {
260
+ for key := range v {
261
+ numVotes += v[key]
262
+ }
263
264
265
c.HTML(http.StatusOK, "result.tmpl", gin.H{
266
"Id": poll.Id,
267
"Title": poll.Title,
268
"Description": poll.Description,
269
"VoteType": poll.VoteType,
270
"Results": results,
- "NumVotes": len(results),
271
+ "NumVotes": numVotes,
272
"IsOpen": poll.Open,
273
"IsHidden": poll.Hidden,
274
"CanModify": canModify,
0 commit comments