Retrieving a post's likes

197 views Asked by At

In my application, I have a 'user_post' feed which is responsible for storing the posts of a user. I would like a way to retrieve the likes of each individual post.

If I added a feed called 'post_like' I could store the likes of each post in their own feed. Is this approach efficient?

1

There are 1 answers

0
iandouglas On

I'd suggest using a notification feed for that, not a flat feed. Set the verb to 'like' or whatever is appropriate for your app, and the actor is the user who 'liked' the original activity. When you call the user's notification feed, you'll get a list of all users who liked it.

If you store the likes in your own database and send the like to us with a foreign ID then you can always remove the activity later if they 'un-like' something afterward.