So I implemented the like feature,, and there wont' be any dislike/downvote/flag feature
.. that's and evil feature :p according to me
Here were the steps
- implement like method in the back end (GraphQL)
- integrate on front end.
Where a user likes a post, it does a few things
- calls the method to post the like
- get the updated post, since after the like was submitted, rewards, etc things changed. so need to get the updated post
fetching the post, and updating it at first I thought would be tricky,
since you need to cast the like, get the post, find the post in existing array, and they update the existing array, then rerender the page.. which was bad way to do it.
... with my clever mind guys :p
I only cast the like, and fetch and display the updated post,
don't update the array, so technically the array still holds the old data.. but the data which user sees, is updated,
for people who don't liek the technical details here are the photos
and it seemlessly updates