2 ms·
// Override Backbone.sync to use the PUT HTTP method for PATCH requests // when doing Model#save({...}, { patch: true }); var originalSync = Backbone.sy
by philfreo 14y ago
// Override Backbone.sync to use the PUT HTTP method for PATCH requests
// when doing Model#save({...}, { patch: true });
var originalSync = Backbone.sync;
Backbone.sync = function(method, model, options) {
if (method === 'patch') options.type = 'PUT';
return originalSync(method, model, options);
};