next-routes
next-routes copied to clipboard
Router.pushRoute is case sensitive when using dynamic routes
As an example if Icreate a route like this: .add('searchPage', '/:region/:activity(for-sale|for-rent)/search', 'searchPage')
And the use: Router.pushRoute('searchPage', { ...updatedQuery, activity: query.activity, region: query.region }) If a user goes to the url writing For-Sale instead of for-sale, or it has any case difference, and then the user triggers a pushRoute, we get the following error:
Our temporary solution was to pass: Router.pushRoute('searchPage', { ...updatedQuery, activity: query.activity.toLowerCase, region: query.region })