We have two routes in fluxible-router. I need that if legacyDek route is accessed, then after an action completed, it would redirect to the deck route.
deck: {
path: '/deck/:id(\\d+|\\d+-\\d+)/:stype?/:sid?/:spath?/:mode?/:theme?',
method: 'get',
page: 'deck',
handler: require('../components/Deck/Deck'),
action: (context, payload, done) => {
async.series([
(callback) => {
context.executeAction(loadDeck, payload, callback);
},
(callback) => {
context.executeAction(loadPresentation, payload, callback);
}
],
(err) => {
if(err) console.log(err);
done();
});
}
},
legacydeck: {
path: '/deck/:oldid(\\d+_\\w+.*)',
method: 'get',
action: (context, payload, done) => {
context.executeAction(loadLegacy, payload, (err, result) => {
if (err) console.log(err);
context.executeAction(navigateAction, {'url' : '/deck/' +result}, done);
});
}
},
The redirect itself does work properly, however the url line stays the same. Can someone explain - why is this and how to do the redirect completely?
For now the only solution is the following: 1. Change the action which triggers the redirect in such a manner, that it returns an error object, in my example: