niiknow / vue-datatables-net

Vue jQuery DataTables.net wrapper component
https://niiknow.github.io/vue-datatables-net/
MIT License
171 stars 58 forks source link

How to disable error alert? #27

Closed gwachhamit closed 4 years ago

gwachhamit commented 4 years ago

How to disable alert of error message? and I want to catch error response code mannually. Because I want to redirect to login if the response status code is 401.

gwachhamit commented 4 years ago

Sorry, for the silly question. I fixed it by adding error in ajax request.

                    ajax: {
                        url: '/admin/brands',
                        error: function (xhr, error, thrown) {
                            if(xhr.status === 401){
                                location.replace('/login');
                            }else {
                                console.log(error, thrown);
                            }
                        }
                    },