Remove useless intermediary variable in elections.go

This commit is contained in:
2025-01-02 19:27:31 +01:00
parent 0229f78976
commit a9278366dd

View File

@ -77,15 +77,12 @@ func (e *ElectionModel) GetById(id int) (*Election, error) {
row := e.DB.QueryRow(query, id)
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 {
return nil, err
}
election.AreVotersKnown = areVotersKnown == 1
// Retrieve choices for the election
queryChoices := `
SELECT text