I have a SetInterval inside to a Promise in Axios. When I try to execute a function in this SetInterval, I have the follow error:
methods: {
getJson() {
axios.post(url, FormObject, config)
.then(response => {
var searchId = JSON.stringify(response.data.searchId)
this.sendStatus(searchId)
var status = setInterval(function(){ this.sendStatus(searchId) },
30000);
})
.catch(err => (this.error = err))
},
sendStatus(searchId){},
}
The first call (this.sendStatus(searchId)) working correctly. However, the setInterval return this error:
Uncaught TypeError: this.sendStatus is not a function at eval