Skip to content

Commit

Permalink
Implement approval vote ballot
Browse files Browse the repository at this point in the history
  • Loading branch information
selankon committed Apr 29, 2024
1 parent 885bb00 commit f3ec91f
Showing 1 changed file with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,15 @@ export const ElectionQuestions = (props: ElectionQuestionsProps) => {
}
}
break
case ElectionResultsTypeNames.APPROVAL:
results = election.questions[0].choices.map((c, k) => {
if (values[0].includes(k.toString())) {
return 1
} else {
return 0
}
})
break
default:
throw new Error('Unknown or invalid election type')
}
Expand Down

0 comments on commit f3ec91f

Please sign in to comment.