Prevent a user from Liking the same post twice
Closed this issue · 0 comments
mViolet commented
Possible solution: A collection of objects storing liked posts for each user
Might work like this: Add or remove the post to the collection each time a user clicks Like:
- check if clicked post is in the user's list/collection.
- If not, add it and increment the likes count on that post
- If it is, remove it and decrement the likes count on that post