calluswhatyouwant/musicritic

Create endpoint for adding album reviews

Closed this issue · 0 comments

Create endpoint on backend to add reviews to track.

endpoint:

/albums/{album id on spotify}/reviews

  • POST
    1. It will receive a JSON with the format:
    {
     "user": "userId",
     "album": "id of the album on spotify",
     "rating": 4.5,
     "review": "[OPTIONAL OBJECT TO BE DEFINED]"
    }
    1. Store it in a collection "reviews/albums" (there is a concept of subcollection on firestore) using the firebase cloud firestore, we already have an example using the cloud firestore here
    2. Return the review JSON with its id

if the #69 is already done, this endpoint must be protected to be called only by logged users