SE310-1 / W.A.K

W.A.K is a movie tracker web-app developed to simplify and enhance the movie-rating experience while making this process more fun and customisable.
MIT License
2 stars 12 forks source link

Implement back-end support for favorite movies list feature #60

Closed skau811 closed 1 year ago

skau811 commented 1 year ago

This Pull Request introduces few additions to the backend to support the functionality of adding, viewing, and editing favorite movies for users:

Server-Side Endpoints

User Schema Updates

Instance Methods in userModel

With these additions, the backend now has the relevant functions to incorporate the favorite movies list feature, thereby progressing towards the closure of #53 .

MRlolface249 commented 1 year ago

Would you be able to provide some screenshots or documentation for the testing please?

skau811 commented 1 year ago

The testing of the endpoints was done using POSTMAN. Below are the requested screenshots which show the relvant requests and the state of the user document as a result of those interactions:

Background : The screenshots below are the result of the interactions with the user document with lightYG as the username, all the requests to the endpoints include the authorization token in the header (generated during login/signup), and take place using this token.

For further context: image

Testing the get all favorite movies endpoint image From mongoDB database: image

Testing the add to favorites endpoint image

image From mongoDB (889 is now present in the list): image

Testing the remove from favorites endpoint image From mongoDB (1235 is not present there): image

Testing if a particular movie is present in favorites list endpoint image Since 1235 was removed in the previous remove request, we get this message.

MRlolface249 commented 1 year ago

thankyou for adding the documentation