Closed aitikgupta closed 3 years ago
@aitikgupta Actually, is that really needed to store the unique id of posts in the users' table
@bodhisha That makes sense, similar argument can be made for storing the unique id of likes in the posts' table
We can divide our /posts API in a way that 2 calls will have to be made for a single post. (Actually 3)
But from an end-user's perspective, the question is do we want 3 calls to get a single post? (I think Yes)
Let's say a user clicked on the Like button -> We will call the 2nd API to update the likes Let's say a user commented -> We will call the 3rd API to update the comments All other metadata like Image and Description and Author Name/Email -> We will call the 1st API
/post/delete
only deletes the instance fromposts_collection
, it should also remove it's unique id from user's posts (list of unique ids)