Created
September 25, 2017 14:05
-
-
Save Attila03/62e647427f843ca6beba58fe9c54ad1f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
actions : { | |
createTourney (context, payload) { | |
return new Promise (resolve, reject) { | |
// prepare data to be sent | |
axios({ | |
// mthod,url, data.... | |
validateStatus: function (status) { | |
return (status >= 200 && status < 300) || (status === 400) | |
} | |
}).then(response => { | |
if (response.status === 400) { | |
resolve(response) | |
} else { | |
//store commits | |
} | |
}).catch(error => { | |
console.log(error) | |
}) | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment