Fix summarizing vote results
This commit is contained in:
parent
f27f2bf801
commit
12796486d2
1 changed files with 6 additions and 4 deletions
|
@ -458,13 +458,15 @@ func sumsForDecision(ctx context.Context, tx *sqlx.Tx, d *Motion) (*VoteSums, er
|
|||
return nil, fmt.Errorf("could not parse row for vote sums of motion %s: %w", d.Tag, err)
|
||||
}
|
||||
|
||||
switch vote {
|
||||
case VoteAye:
|
||||
switch vote.ID {
|
||||
case VoteAye.ID:
|
||||
sums.Ayes = count
|
||||
case VoteNaye:
|
||||
case VoteNaye.ID:
|
||||
sums.Nayes = count
|
||||
case VoteAbstain:
|
||||
case VoteAbstain.ID:
|
||||
sums.Abstains = count
|
||||
default:
|
||||
return nil, fmt.Errorf("unknown vote type '%+v'", vote)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue