✨ Display votes in non-anonymous voting results
This commit is contained in:
parent
58cb8645a4
commit
f2f8265499
6 changed files with 42 additions and 5 deletions
|
|
@ -86,6 +86,7 @@ func getVotes(id string) ([]vote.Vote, error) {
|
|||
return nil, err
|
||||
}
|
||||
var (
|
||||
i string
|
||||
e string
|
||||
c vote.Choice
|
||||
ts time.Time
|
||||
|
|
@ -94,7 +95,7 @@ func getVotes(id string) ([]vote.Vote, error) {
|
|||
votes = []vote.Vote{}
|
||||
)
|
||||
for result.Next() {
|
||||
if err = result.Scan(&e, &dbChoice, &dbTimestamp); err != nil {
|
||||
if err = result.Scan(&i, &e, &dbChoice, &dbTimestamp); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
|
|
@ -106,7 +107,7 @@ func getVotes(id string) ([]vote.Vote, error) {
|
|||
return nil, err
|
||||
}
|
||||
|
||||
v := vote.NewVoteWithTimestamp(e, c, ts)
|
||||
v := vote.NewVoteWithTimestamp(i, e, c, ts)
|
||||
votes = append(votes, v)
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -125,6 +125,7 @@ func initStmtVoteSelect(db *sql.DB) {
|
|||
var err error
|
||||
if voteSelect, err = db.Prepare(`
|
||||
SELECT
|
||||
id,
|
||||
elector,
|
||||
choice,
|
||||
timestamp
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue