Skip to content

Commit

Permalink
[BUGFIX beta] Move jQuery.ajax call to a method separate method
Browse files Browse the repository at this point in the history
Allow for overriding of the `ajax` request by overriding
`RESTAdapter.ajaxRequest` instead of the `RESTAdapter.ajax`, which
perform promise wrapping and Ember Data specific errors
  • Loading branch information
danmcclain committed Jan 26, 2016
1 parent c540db1 commit 5dab079
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion addon/adapters/rest.js
Original file line number Diff line number Diff line change
Expand Up @@ -881,10 +881,19 @@ export default Adapter.extend(BuildURLMixin, {
Ember.run.join(null, reject, error);
};

Ember.$.ajax(hash);
adapter._ajaxRequest(hash);
}, 'DS: RESTAdapter#ajax ' + type + ' to ' + url);
},

/**
@method _ajaxRequest
@private
@param {Object} options jQuery ajax options to be used for the ajax request
*/
_ajaxRequest(options) {
Ember.$.ajax(options);
},

/**
@method ajaxOptions
@private
Expand Down

0 comments on commit 5dab079

Please sign in to comment.