Changeset 6230 for sandbox/2.4-expresso-api/prototype/api/datalayer.js
- Timestamp:
- 05/18/12 11:12:43 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sandbox/2.4-expresso-api/prototype/api/datalayer.js
r5888 r6230 198 198 else 199 199 result = dt; 200 201 }, 202 'error': function( dt, textStatus, jqXHR ){ 203 204 if( callback ) 205 { 206 fired = true; 207 result = callback( $.parseJSON(dt.responseText), textStatus, jqXHR ); 208 } 209 else 210 result = $.parseJSON(dt.responseText); 200 211 201 212 }, … … 254 265 create: function( uri, data, callback, accept ){ 255 266 256 return this.send( this.dispatchPath +'rest' + uri, [ 'post', accept || 'json' ], data, callback, !!!callback,267 return this.send( 'rest' + uri, [ 'post', accept || 'json' ], data, callback, !!!callback, 257 268 {'beforeSend' : function (xhr){ 258 269 xhr.setRequestHeader('Authorization', "OAUTH Bearer " + DataLayer.me.token)} … … 272 283 update: function( uri, data, callback, accept ){ 273 284 274 return this.send( this.dispatchPath +'rest' + uri, [ 'put', accept || 'json' ], data, callback, !!!callback,285 return this.send( 'rest' + uri, [ 'put', accept || 'json' ], data, callback, !!!callback, 275 286 {'beforeSend' : function (xhr){ 276 287 xhr.setRequestHeader('Authorization', "OAUTH Bearer " + DataLayer.me.token)} … … 290 301 "delete": function( uri, callback, accept ){ 291 302 292 return this.send( this.dispatchPath +'rest' + uri, [ 'delete', accept || 'json' ], false, callback, !!!callback,303 return this.send( 'rest' + uri, [ 'delete', accept || 'json' ], false, callback, !!!callback, 293 304 {'beforeSend' : function (xhr){ 294 305 xhr.setRequestHeader('Authorization', "OAUTH Bearer " + DataLayer.me.token)}
Note: See TracChangeset
for help on using the changeset viewer.