X-Git-Url: http://git.ithinksw.org/extjs.git/blobdiff_plain/6e39d509471fe9b4e2660e0d1631b350d0c66f40..2e847cf21b8ab9d15fa167b315ca5b2fa92638fc:/src/data/Api.js diff --git a/src/data/Api.js b/src/data/Api.js index 39668237..8fa96ceb 100644 --- a/src/data/Api.js +++ b/src/data/Api.js @@ -1,6 +1,6 @@ /*! - * Ext JS Library 3.1.0 - * Copyright(c) 2006-2009 Ext JS, LLC + * Ext JS Library 3.1.1 + * Copyright(c) 2006-2010 Ext JS, LLC * licensing@extjs.com * http://www.extjs.com/license */ @@ -184,7 +184,8 @@ new Ext.data.HttpProxy({ restify : function(proxy) { proxy.restful = true; for (var verb in this.restActions) { - proxy.api[this.actions[verb]].method = this.restActions[verb]; + proxy.api[this.actions[verb]].method || + (proxy.api[this.actions[verb]].method = this.restActions[verb]); } // TODO: perhaps move this interceptor elsewhere? like into DataProxy, perhaps? Placed here // to satisfy initial 3.0 final release of REST features. @@ -200,7 +201,12 @@ new Ext.data.HttpProxy({ return true; break; case 201: // entity created but no response returned - res.success = true; + if (Ext.isEmpty(res.raw.responseText)) { + res.success = true; + } else { + //if the response contains data, treat it like a 200 + return true; + } break; case 204: // no-content. Create a fake response. res.success = true; @@ -246,7 +252,7 @@ Ext.data.Response.prototype = { return this.success; }, getStatus : function() { - return this.status + return this.status; }, getRoot : function() { return this.root;