title: Vue.js and Axios: Transform Request returns undefined data
body: <p>I was trying to use transformRequest and transformResponse in order to display a loader while data is rendering. When I have done this, it worked perfectly but it is appeared that my POST and PATCH requests are not processed properly now. There are no error messages on console but when I try to modify some entity (and send PATCH request), nothing happens. When I delete transformRequest function, I can send POST and PATCH.</p>
  
  <p>Can somebody explain what I did wrong?</p>
  
  <p>UPDATE! Here is what I added in http/index.js:</p>
  
  <pre><code>...
  transformRequest(data) {
   console.log(data); // returns undefined
   store.dispatch('loadingData');
   console.log(data) // returns undefined
   return console.log(JSON.stringify(data)); // returns undefined
  },
  transformResponse(data) {
   store.dispatch('finishLoadingData');
   const parsedData = JSON.parse(data);
   if (parsedData.error === 'Access denied') {
     cookies.remove('access_token');
     window.location = `${config.mainSite}/login`;
   }
   return parsedData;
  },
  ...
  </code></pre>
  
  <p>Here is the store:</p>
  
  <pre><code>export default {
   state: {
    loading: false,
   },
   actions: {
    loadingData({ commit }) {
     commit('LOADING_DATA');
   },
   finishLoadingData({ commit }) {
     commit('FINISH_LOADING_DATA');
   },
  },
  mutations: {
   LOADING_DATA(state) {
    state.loading = true;
   },
   FINISH_LOADING_DATA(state) {
    state.loading = false;
   },
  },
  getters: {
    getLoading(state) {
     return state.loading;
    },
   },
  };
  </code></pre>