Callback function not working in Axios javascript : <p>Im trying to make a register form with VueJS and Axios and Laravel.
I've written the following shortcut function to make a post request and handle laravel form validations errors:</p>

<pre><code>window.post = function (vueResource, url, data, responseCallback){

let _rsrc = vueResource;
let _data = vueResource.$data;

if(data !== ''){
    _data = data;
}

axios.post(url, _data).then(responseCallback).catch(function(error){
      if(error.response.status == 422){
          _rsrc.errors = error.response.data.errors;
          return false;
      }
      throw error;
});
}
</code></pre>

<p>Now when i make a post request, using the following code:</p>

<pre><code> post(this,'/api/register','',function(response){
        alert(1);
 });
</code></pre>

<p>The request is done, a user is created, but the callback function is not executed. There's no alert. </p>

<p>Why is this not working?</p>
