High-Table-Consortium / fullstack-capstone-dockerized

0 stars 3 forks source link

Favourites route #117

Closed NtokozoMitchell closed 3 weeks ago

NtokozoMitchell commented 1 month ago

-Create an API route for favourites that handles both GET and DELETE requests for managing favorite attractions. The API should be able to retrieve the list of favorite attractions and allow users to remove an attraction from their favorites.

Functionality -GET Request: Retrieves the list of favorite attractions and returns it as a JSON response.

-DELETE Request: Accepts an ID in the request body to remove a specific favorite attraction. Returns appropriate error messages if the ID is not provided or if the favorite is not found.

Test: GET localhost:3000/api/favourites -Should return the list of favorite attractions in JSON format.