krishnaacharyaa / wanderlust

WanderLust is a MERN travel blog website 🚀 This project is aimed to help people to contribute in open source, upskill in react and master git.
https://wanderlust-beta.vercel.app/
MIT License
221 stars 1.25k forks source link

[FEATURE] Implement Post Like #339

Open Ashu0216 opened 6 months ago

Ashu0216 commented 6 months ago

Description

Like feature can be implemented to allow users to like any post.

Use Case

A Like button will be added on the full page view of the post from wherein a user can choose to like a post. The total number of likes received can be displayed on respective post's cards.

Proposed Solution

The solution includes both backend and frontend tasks. Backend : Required changes will have to be made to the schema for additional 'Like' fields. Functions need to be implemented to add like and remove a like with edge case handling Frontend: Like count will be shown on each post's card. Will use react hooks to perform the action of like.

Additional Information

No response

Attachments

Here is an idea of how it will look after feature completion: image

nishant0708 commented 6 months ago

Hey Can you Assign me this issue under gssoc 24

VijayaragavanS1999 commented 6 months ago

Can you assign me this feature. I have an idea to do this, have to add Like field in schema which is array of user _ids. whenever the user clicked the like, user have to pass their _id so that we can push to that array and vise versa for disliking.

vamsidhar-914 commented 5 months ago

Hi. i know how to implement this.we can add like field in schema which has type Array default with no values.when user clicked on like button a like with userIds gets pushed to that array i can do this ETA: 1 day

can you assign me this feature

shivansh84ya commented 4 months ago

Hi @Ashu0216 , I would like to work on this issue. Could you please assign it to me?