There’re some problems with your code.
But one of them is not a problem with the code itself but with the logics behind it:
In your case if several members navigate to the page at the same time and upvote an item, they will override each other. The solution for your code depends on whether or not you care about this problem (it’ll be a different code with different logics if you wish to avoid this problem).