Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
post(url, data, done, fail) {
return axios({
method: "post",
url,
data: querystring.stringify(data),
headers: {
"X-Requested-With": "XMLHttpRequest",
"Content-Type": "application/x-www-form-urlencoded; charset=UTF-8"
}
})
.then(data => done(data))
.catch(error => {
if (fail) {
fail(error);
} else {
toast.error({
message: error,
animateIn: "shake",
animateOut: "fadeOutDown",
duration: 3000
});