Remove useless intermediary variable in elections.go
This commit is contained in:
@ -77,15 +77,12 @@ func (e *ElectionModel) GetById(id int) (*Election, error) {
|
|||||||
row := e.DB.QueryRow(query, id)
|
row := e.DB.QueryRow(query, id)
|
||||||
|
|
||||||
election := &Election{}
|
election := &Election{}
|
||||||
var areVotersKnown int
|
|
||||||
|
|
||||||
err := row.Scan(&election.ID, &election.Name, &election.Tokens, &areVotersKnown, &election.MaxVoters, &election.CreatedAt, &election.ExpiresAt)
|
err := row.Scan(&election.ID, &election.Name, &election.Tokens, &election.AreVotersKnown, &election.MaxVoters, &election.CreatedAt, &election.ExpiresAt)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
election.AreVotersKnown = areVotersKnown == 1
|
|
||||||
|
|
||||||
// Retrieve choices for the election
|
// Retrieve choices for the election
|
||||||
queryChoices := `
|
queryChoices := `
|
||||||
SELECT text
|
SELECT text
|
||||||
|
Reference in New Issue
Block a user