Closed brian3t closed 6 years ago
Consider this case
var app.my_book = new Backbone.Model({ url_root: 'https://myserver/v1/books'); app.my_book.fetch(); // I forgot to set the book's id before fetching
Now app.my_book contains the list of all the books from REST server. This is because fetch was called without an id.
Suggest: if id is not set, fetch should return null and does nothing.
Thanks.
Some models only have URLs, and not ids.
Ok thanks. I ended up extending the Model, but I guess it's just me then. Keep up the good work!
Consider this case
var app.my_book = new Backbone.Model({ url_root: 'https://myserver/v1/books'); app.my_book.fetch(); // I forgot to set the book's id before fetching
Now app.my_book contains the list of all the books from REST server. This is because fetch was called without an id.
Suggest: if id is not set, fetch should return null and does nothing.
Thanks.