diff options
author | Eric Eastwood <contact@ericeastwood.com> | 2017-12-15 01:10:34 -0600 |
---|---|---|
committer | Eric Eastwood <contact@ericeastwood.com> | 2018-01-02 18:01:00 -0600 |
commit | ac9e65a9b9fdc8964f4891eedd51ed57aa5ee22b (patch) | |
tree | 7e0f477f9f4503aed67a51493bd17b9dbbea13c7 /app/assets/javascripts/blob | |
parent | 254c0754eb668ecbb78650d72510ca199a9820de (diff) | |
download | gitlab-ce-ac9e65a9b9fdc8964f4891eedd51ed57aa5ee22b.tar.gz |
Switch blob/notebook to Axios
Diffstat (limited to 'app/assets/javascripts/blob')
-rw-r--r-- | app/assets/javascripts/blob/notebook/index.js | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/app/assets/javascripts/blob/notebook/index.js b/app/assets/javascripts/blob/notebook/index.js index c858a6bb7b4..57b031956e8 100644 --- a/app/assets/javascripts/blob/notebook/index.js +++ b/app/assets/javascripts/blob/notebook/index.js @@ -1,10 +1,8 @@ /* eslint-disable no-new */ import Vue from 'vue'; -import VueResource from 'vue-resource'; +import axios from '../../lib/utils/axios_utils'; import notebookLab from '../../notebook/index.vue'; -Vue.use(VueResource); - export default () => { const el = document.getElementById('js-notebook-viewer'); @@ -50,14 +48,14 @@ export default () => { `, methods: { loadFile() { - this.$http.get(el.dataset.endpoint) - .then(response => response.json()) - .then((res) => { - this.json = res; + axios.get(el.dataset.endpoint) + .then(res => res.data) + .then((data) => { + this.json = data; this.loading = false; }) .catch((e) => { - if (e.status) { + if (e.status !== 200) { this.loadError = true; } |