charbelfakhry / csis_279_fall_23_nest

5 stars 1 forks source link

LIKES Management #10

Closed charbelfakhry closed 9 months ago

charbelfakhry commented 9 months ago

CRUD for LIKES include controller, services and DTO

aboudekahil commented 9 months ago

Hello, for the likes, i think you should do a likes service and work on the post and comments controllers themselves. The following routes should be implemented.

POST CONTROLLER:

POST /like (body: id of the post to like) GET /likes?postid= (where the query parameter is the post id of the post to get the number of likes on it) DELETE /like (to unlike a post, same body as POST /like) GET /liked-users?postid= (where the query parameter is the post id of the post to get a list of all the users that liked the post)

COMMENTS CONTROLLER:

POST /like (body: id of the comment to like) GET /likes?commentid= (where the query parameter is the comment id of the comment to get the number of likes on it) DELETE /like (to unlike a comment, same body as POST /like)

use the jwt to get the user id of the liker.

Thank you