View on GitHub

DevQuest 2024

DevQuest is an international hackathon organized under the tertiary category of CODEFEST, aimed at showcasing the unique talents, creativity, and innovations of undergraduates from universities and institutes worldwide.

Challenge 08 - Add/Update feedback for a movie

For this challenge you need to implement the following API endpoints

POST /api/feedback
GET /api/feedback/:movieId

Part a

When a user submits feedback, including a rating and comment, for a movie they haven’t reviewed before, the system should save it in the feedback table.

The response should be similar to the following.

"data": {
        "userId": "c784dd78-b26e-4cc0-9c8a-b84bdb4330b9",
        "movieId": "a742a595-e707-458a-9240-66742251dabf",
        "rating": 5,
        "comment": "Great movie! I loved it! The plot was amazing and the acting was superb!",
        "createdAt": "2024-04-15T10:36:51.658Z"
    }

Part b

When a user attempts to submit additional feedback for a movie they’ve already reviewed, the system should update the existing feedback in the database and retrieve it.

The response should look like this.

"data": {
        "userId": "c784dd78-b26e-4cc0-9c8a-b84bdb4330b9",
        "movieId": "b5f37e47-40a7-4688-b6aa-420356eabcf8",
        "rating": 4,
        "comment":"Interesting movie! The plot was intriguing and the acting was good! I would watch it again!",
        "createdAt": "2024-04-15T11:15:54.299Z"
    }