SocietyClub / RCV

Ranked Choice Voting application
https://www.rankedchoice.info/
2 stars 0 forks source link

Bk improve create and update poll #81

Closed binamkayastha closed 2 years ago

binamkayastha commented 2 years ago

Description

Makes the update and create polls logic better

Loading

Next response object requires you to call json or send for the response to actually be sent. Loading circle was added when the update button was clicked, and was abstracted to it's own component

Alerting/Validating

Alert when candidate name is empty Alert when maxCandidateCount is higher than candidate list length Alert when both are bad
image image image

Poll creation and update validation was moved to a shared utlis file at toplevel. If we wish to use it for the frontend, we could try to use the same logic, though we would need to make some adjustments to know which fields in the frontend to mark as "invalid" like specifying the indexes of which candidate names are empty etc.

Deleting

On both createPoll and updatePoll, delete buttons were added image

vercel[bot] commented 2 years ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
rcv ✅ Ready (Inspect) Visit Preview Jul 31, 2022 at 4:30PM (UTC)