Closed fdm1 closed 1 year ago
Thanks for the PR @fdm1 . I think the user params should always take precedence over the inherited params.
The issue seems to come from this line https://github.com/roxiness/routify/blob/aff213471b025561f95f19f16e76ab2d52b9b863/runtime/utils/index.js#L152
Something like this might solve it
const re = new RegExp(`:${key}(\/|$)`)
path = path.replace(`:${key}`, value)
👍 @jakobrosenberg that seems to work fine, other than it flips out putting a const
or let
in the for
loop. Either way, pushing that up.
Look good. Could I get you to reverse the inheritedParams and params on L148?
Could I get you to reverse the inheritedParams and params
Done and done
Much appreciated. 🙏 The fix should be available in a couple of minutes.
:tada: This PR is included in version 2.18.10 :tada:
The release is available on:
Your semantic-release bot :package::rocket:
If calling
$url("/some/path/:user_id", {user_id: 123})
, but your current path was "/foo/bar?u=789", because thepopulateUrl
function uses theinheritedParams
first, the result of that$url
call would be/some/path/789ser_id
, because it would replace only the:u
part from the state params, instead of using the full:user_id
from the passed params.