These are the path url's that my server has:
GET /watchlists
GET /watchlists/:id
POST /watchlists // Create a new watchlists
PUT /watchlists/:id // Change attributes of watchlists (Like name)
POST /watchlists/:id/movies // Add a movie
DELETE /watchlists/:id/movies/:trackId // Delete a movie by the trackid
DELETE /watchlists/:id // Delete the watchlists by is ID
Here is my model:
var WatchlistModel = Backbone.Model.extend({
urlRoot: '/watchlists',
});
I want to know how to do the 'add a movie' with this url:
/watchlists/:id/movies
and the delete call:
/watchlists/:id/movies/:trackId
What are the best pratices for that?