diff options
author | Jacob Schatz <jschatz1@gmail.com> | 2017-08-09 16:24:48 +0300 |
---|---|---|
committer | Mike Greiling <mike@pixelcog.com> | 2017-08-17 23:55:23 +0300 |
commit | 725a4fef5aeea02bea3f943133d075177424117d (patch) | |
tree | 350aa2807516dba9b32738acd312062345f226ce /app/assets/javascripts/api.js | |
parent | 91d3e6d9011edd19f980a8a0864ff0f673513011 (diff) |
Add thenable ajax calls.
Diffstat (limited to 'app/assets/javascripts/api.js')
-rw-r--r-- | app/assets/javascripts/api.js | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/app/assets/javascripts/api.js b/app/assets/javascripts/api.js index 56f91e95bb9..28119362455 100644 --- a/app/assets/javascripts/api.js +++ b/app/assets/javascripts/api.js @@ -99,15 +99,13 @@ const Api = { commitMultiple(id, data, callback) { const url = Api.buildUrl(Api.commitPath) .replace(':id', id); - return $.ajax({ + return this.wrapAjaxCall({ url, type: 'POST', contentType: 'application/json; charset=utf-8', data: JSON.stringify(data), dataType: 'json', - }) - .done(commitData => callback(commitData)) - .fail(message => callback(message.responseJSON)); + }); }, // Return text for a specific license |