Tuesday 25 June 2019

How to do I know the correct URL to like/unlike a comment in MERN?

First of all, I'm sorry if this is not the place to ask. I will delete the post if requested.Let's say I have the following URL:http://localhost:3000/demo/_idInside that URL I have the entry for said _id and some comments which can receive likes by the user. How can I know what's the current URL to like the comments? Assuming I can already like the parent _id(the entry). Here it is an image of my MongoDB database:​MongoDB Test DatabaseAs you can see in the image above there's a field called likes in the comment. My question is how would I go to make it like-able?.This is what I have in my actions file for liking the entry. Can somebody guide me and tell me how to edit it to like X comment found in the entry?:​https://i.redd.it/r7yno0wrnm631.jpgAnd this is what I have in my API route(again this is for X entry; how can I edit to like a comment):​https://i.redd.it/75h6l7vsnm631.jpgHopefully I could explain myself well enough and thanks for bothering!.

Submitted June 26, 2019 at 05:19AM by kirasiris

No comments:

Post a Comment