diff options
author | Eric Eastwood <contact@ericeastwood.com> | 2017-12-15 10:10:34 +0300 |
---|---|---|
committer | Eric Eastwood <contact@ericeastwood.com> | 2018-01-03 03:01:00 +0300 |
commit | ac9e65a9b9fdc8964f4891eedd51ed57aa5ee22b (patch) | |
tree | 7e0f477f9f4503aed67a51493bd17b9dbbea13c7 /app | |
parent | 254c0754eb668ecbb78650d72510ca199a9820de (diff) |
Switch blob/notebook to Axios
Diffstat (limited to 'app')
-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; } |