When navigating to a page in my router, I make a REST API request to retrieve data from the server in the beforeEnter
clause as shown below:
beforeEnter: (to, form, next) => {
getData().then(
(response) => {
//some logic to get data
next(); //if no error redirect to page
},
(error) => {
next(false); //on error not redirect on page - at this moment, I want to display information about internal server error
});
}
I have a question now: How can I display a toast/notification with the message "Internal server error" when an error occurs in my beforeEnter
function?
Thank you for any assistance.