removed empty names from options list before solve

This commit is contained in:
Jack Wines 2023-07-06 19:55:35 -07:00
parent 120040886f
commit d4b9090839

View file

@ -55,7 +55,7 @@ results pollId = do
case toNonEmptyList . P.votes $ poll of case toNonEmptyList . P.votes $ poll of
Nothing -> fullPage "poll doesn't have any votes" Nothing -> fullPage "poll doesn't have any votes"
Just votesList -> do Just votesList -> do
let results' = IR.solve (LN.toList . P.options . P.createInfo $ poll) votesList let results' = IR.solve (filter (not . T.null) . LN.toList . P.options . P.createInfo $ poll) (votesList)
fullPage $ do fullPage $ do
h2_ "results" h2_ "results"
toHtml $ T.append (T.pack . show . length . P.votes $ poll) " ballots submitted" toHtml $ T.append (T.pack . show . length . P.votes $ poll) " ballots submitted"