This PR introduces backend modifications necessary for addressing the final task (favorites list reordering feature) outlined in #53.
Modification of the existing favorites list field in the user schema to capture additional details about the added movie, such as the movie title and the date added.
Alteration of the server routes to align with the updated field and the inclusion of a route that allows sorting of the list based on ratings (from highest to lowest) and the date added (most recent first).
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
Sending request in Postman:
DB after the interaction:
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:
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)
This is as expected.
Making a request to get all the favourites with the rating option :
This also works as expected.
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 Sending request in Postman: DB after the interaction:
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:
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) This is as expected.
Making a request to get all the favourites with the rating option : This also works as expected.