diff options
author | Eric Eastwood <contact@ericeastwood.com> | 2017-12-15 00:11:00 -0600 |
---|---|---|
committer | Eric Eastwood <contact@ericeastwood.com> | 2018-01-02 18:00:04 -0600 |
commit | 254c0754eb668ecbb78650d72510ca199a9820de (patch) | |
tree | 08a9967dc9b3bd5307d94b350ad316ee5ef07909 /app/assets/javascripts/vue_merge_request_widget/mr_widget_options.js | |
parent | d2e5313ad8134167ae1838b08dd8f20ed5a0261d (diff) | |
download | gitlab-ce-254c0754eb668ecbb78650d72510ca199a9820de.tar.gz |
Switch vue_merge_request_widget to Axios
Diffstat (limited to 'app/assets/javascripts/vue_merge_request_widget/mr_widget_options.js')
-rw-r--r-- | app/assets/javascripts/vue_merge_request_widget/mr_widget_options.js | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/app/assets/javascripts/vue_merge_request_widget/mr_widget_options.js b/app/assets/javascripts/vue_merge_request_widget/mr_widget_options.js index 8a9129c385b..fdae06200de 100644 --- a/app/assets/javascripts/vue_merge_request_widget/mr_widget_options.js +++ b/app/assets/javascripts/vue_merge_request_widget/mr_widget_options.js @@ -84,14 +84,14 @@ export default { }, checkStatus(cb) { return this.service.checkStatus() - .then(res => res.json()) - .then((res) => { - this.handleNotification(res); - this.mr.setData(res); + .then(res => res.data) + .then((data) => { + this.handleNotification(data); + this.mr.setData(data); this.setFaviconHelper(); if (cb) { - cb.call(null, res); + cb.call(null, data); } }) .catch(() => { @@ -124,10 +124,10 @@ export default { }, fetchDeployments() { return this.service.fetchDeployments() - .then(res => res.json()) - .then((res) => { - if (res.length) { - this.mr.deployments = res; + .then(res => res.data) + .then((data) => { + if (data.length) { + this.mr.deployments = data; } }) .catch(() => { @@ -137,9 +137,9 @@ export default { fetchActionsContent() { this.service.fetchMergeActionsContent() .then((res) => { - if (res.body) { + if (res.data) { const el = document.createElement('div'); - el.innerHTML = res.body; + el.innerHTML = res.data; document.body.appendChild(el); Project.initRefSwitcher(); } |