I am using the element-ui file upload component(https://element.eleme.io/#/en-US/component/upload) to handle the frontend of image uploading. everything is working perfectly(file is sent to the server etc). However for some strange reason after the the axios's successful response code executes, the page refreshes automatically. I have tried sending the same post request without the file and the page doesnt automatically refresh.
The submit button type is set to "button" so that is not the issue in this case.
Code for axios post request:
base.post('/add/visit/', formData, {headers: {'Authorization' : 'Bearer ' + localStorage.getItem('token') ,'Content-Type': 'multipart/form-data'}})
.then(response => {
console.log(response);
resolve(response)
})
.catch(err => {
console.log(err)
reject(err)
})
})