mirror of
https://github.com/jashkenas/backbone.git
synced 2026-04-08 03:00:26 -04:00
Only send the model on create and update... It's better for destroy not to bother with it.
This commit is contained in:
@@ -603,7 +603,8 @@
|
||||
// * Persist models via WebSockets instead of Ajax.
|
||||
//
|
||||
Backbone.sync = function(method, model, success, error) {
|
||||
var data = method === 'read' ? {} : {model : JSON.stringify(model)};
|
||||
var sendModel = method === 'create' || method === 'update';
|
||||
var data = sendModel ? {model : JSON.stringify(model)} : {};
|
||||
$.ajax({
|
||||
url : getUrl(model),
|
||||
type : methodMap[method],
|
||||
|
||||
Reference in New Issue
Block a user