panda-express-js / Atelier

0 stars 7 forks source link

Timing of the setState #121

Closed stevkim closed 4 months ago

stevkim commented 4 months ago

https://github.com/panda-express-js/FEC/blob/73c46e6a571b4171b2f23c64ad3a88c06a3ab5c7/client/src/components/questionsAndAnswers/Question.jsx#L18

Does it make sense to fire this if the request fails?

FloraLZhang commented 4 months ago

update the code to only setHasVoted(true) after the put request success. thank you