I am trying to do a thing where I need to edit the Navbar link of my app with the current ID of a customer.
I’ve got the ID being saved in store, and can access it in app.js, and can access the router.navigation.href property, but I’m having trouble editing the route to get it to update and then send the user back to that customer after clicking off that page.
Here’s my route definition:
`
{
route: 'customer/:debtor_id?/:inv_num?/:show_closed_inv_num?',
name: 'customer',
moduleId: PLATFORM.moduleName('customer'),
nav: true,
href: 'customer',
title: 'Customer',
},
`
this is where I attempt to update the router’s href:
`
activate(params)
{
console.log('navigation', this.router);
console.log('state', this.state);
/*
console.log('this', this);
console.log('params', params);
*/
this.consolEvent = this.ea.subscribe('router:navigation:complete', async event => {
console.log('APP ATTACHED', this.state);
if (this.state.customerObj)
{
this.customerNav = this.router.navigation[1];
this.customerNav.href = this.customerNav.href + '/?debtor_id:' + this.state.customerObj.debtor_id;
this.router.navigation[1] = this.customerNav;
}
});
}
`