Fix summarizing vote results

main
Jan Dittberner 1 year ago
parent f27f2bf801
commit 12796486d2

@ -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…
Cancel
Save