Hi have you find a solution for this?
Aug 7, 2018
8
Level 1
How to fix 500 and 429 errors with axios ?
Currently i'm working on a project with Laravel and Vuejs, in almost every components does have http requets at mounted method, but some times when the page is loaded the data wont appear on the page. It happens when navigate through pages randomly, which every page does have http request in mounted method. Then it give these errors,
500 (Internal Server Error)
429 (Too Many Requests)
for example dashboard views mounted method looks like this,
mounted(){
this.role = this.$store.getters.userRole;
var userRole = this.$auth.getUserRole();
axios.get('api/dashboard/getBonusesbyCustomers')
.then( response =>{
this.freeIssues = response.data
console.log('freeIssues')
console.log(this.freeIssues)
}).catch( res =>{
console.log(res)
})
axios.post('api/dashboard/getApprvalList')
.then( response =>{
this.appStock = response.data
console.log(response)
})
axios.get('api/transactions/getItemsCount ')
.then(response =>{
// console.log(response);
this.items = response.data;
})
}
Please or to participate in this conversation.