how do I redirect a user to a 404 Not Found page if an ID does not exist?
I have a dynamic route like so:
const routes = [
{
path: '/',
component: Home
},
{
path: '/content',
component: DataTable
},
{
path: '/content/:NAS_ID', <----what if there's an NAS_ID that does not exist?
name: 'datadetail',
component: DataDetail
},
{
path: '/404',
component: NotFound
},
{
path: '*',
redirect: '/404'
}
];
How would I write a navigation guard for the invalid NAS_ID? Thank you.