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

favourites reordering backend #84

Closed skau811 closed 1 year ago

skau811 commented 1 year ago

This PR introduces backend modifications necessary for addressing the final task (favorites list reordering feature) outlined in #53.

Note: Current user accounts that utilize the former structure for the favorites list may not function as expected. The favorites lists from these accounts might require direct updation through MongoDB database. Also the existing front-end might require adjustments so tasks dependent on the favorites list might be delayed until #53 is fully closed.

This PR contributes to resolving #53. Next steps include the associated front-end modifications to integrate this feature and the adjustments of the current favorites list front-end to ensure compatibility.

Endpoint testing was conducted using POSTMAN as detailed below:

User account: lightYG

Adding a movie to favorites list: Starting with an empty favorites list image Sending request in Postman: image DB after the interaction: image

The newly added movie (Id '937249') was rated with 2 stars using the existing interface. Another movie with the Id '1151534'. It was given a rating of 4. Yet another movie was added with Id '346698'. This movie was not rated.

The MongoDB documents are as follows: image image

Making a request to get all the favourites : (By default , if no option is chosen, it should display the list with recently added movies first) image This is as expected.

Making a request to get all the favourites with the rating option : image This also works as expected.