Set global axios instance using vue-axios wrapper

This commit is contained in:
Bubka
2020-01-26 21:04:33 +01:00
parent 0fd9869230
commit 5531c0e7e1
13 changed files with 77 additions and 28 deletions

View File

@ -1,5 +1,6 @@
import Vue from 'vue'
import Errors from './FormErrors'
import Errors from './FormErrors'
// import { deepCopy } from './util'
class Form {
@ -157,7 +158,7 @@ class Form {
return new Promise((resolve, reject) => {
// (Form.axios || axios).request({ url: this.route(url), method, data, ...config })
axios.request({ url: this.route(url), method, data, ...config })
Vue.axios.request({ url: this.route(url), method, data, ...config })
.then(response => {
this.finishProcessing()
@ -188,7 +189,7 @@ class Form {
return new Promise((resolve, reject) => {
// (Form.axios || axios).request({ url: this.route(url), method, data, ...config })
axios.request({ url: this.route(url), method: 'post', data: formData, header: {'Content-Type' : 'multipart/form-data'} })
Vue.axios.request({ url: this.route(url), method: 'post', data: formData, header: {'Content-Type' : 'multipart/form-data'} })
.then(response => {
this.finishProcessing()