If a previous user vote exists and the vote for which the request failed is the opposite of the previous one, you need to reset the votesAmt twice! Essentially, it has to be like the onMutate logic but inverted. However, I found a shortcut by using the onPrevious hook, and it makes the code more readable too!
P.S: Please be patient; this is my first pull request! Love the content, by the way <3!
Hey Josh,
If a previous user vote exists and the vote for which the request failed is the opposite of the previous one, you need to reset the votesAmt twice! Essentially, it has to be like the onMutate logic but inverted. However, I found a shortcut by using the onPrevious hook, and it makes the code more readable too!
P.S: Please be patient; this is my first pull request! Love the content, by the way <3!