Resolve to a path with parameters in async


#1

Hello,

Am getting a not found error when I try to resolve to a path with defined parameters.

I have this code in my route

{
	path: '/my-records/:music_uuid',
	componentUrl: './pages/record-list.html',
},
{
	path: '/my-records-add-item/:music_uuid/:singer_uuid/',
	async(routeTo, routeFrom, resolve, reject) {
				
					
		//TO SOMETHING
					
		resolve({ 
				
				//componentUrl: './pages/record-list.html?music_uuid='+routeTo.params.music_uuid
				componentUrl: '/my-records/'+routeTo.params.music_uuid, 
				
			});
		
	}
},

When I try resolve to the path /my-records/:record_uuid I get a path not found error.

I would achieve the same objective on a template using

app.router.navigate("/my-records/"+self.$route.params.music_uuid);

Am therefore looking for an equivalent using resolve in async

Any pointers?


#2

You are doing something wrong, if you want kind of redirect, then it must be:

{
	path: '/my-records-add-item/:music_uuid/:singer_uuid/',
	async(routeTo, routeFrom, resolve, reject) {
      const router = this;
  
      //TO SOMETHING

      reject();
      router.navigate('/my-records/'+routeTo.params.music_uuid);
	}
},