Current behavior:
In a child route, when generating the URL of a parent route with parameters, if I explicitly pass in one of those parameters, it is added to the query string in stead of being in the path itself.
E.g.: I'm in #/user/1/preferences/edit and I call: router.generate("userprefs", {id: 1}) I get: #/user/1/preferences?id=1
Even worse, if I call router.generate("userprefs", {id: 2}) I get #/user/1/preferences?id=2.
If I call router.generate("userprefs") I get the expected URL of #/user/1/preferences, which is good.
What is the expected behavior?
Parameters that match path parameters should be used in that path and not be added to the query string.
I'm submitting a bug report
Current behavior: In a child route, when generating the URL of a parent route with parameters, if I explicitly pass in one of those parameters, it is added to the query string in stead of being in the path itself.
E.g.: I'm in
#/user/1/preferences/edit
and I call:router.generate("userprefs", {id: 1})
I get:#/user/1/preferences?id=1
Even worse, if I call
router.generate("userprefs", {id: 2})
I get#/user/1/preferences?id=2
.If I call
router.generate("userprefs")
I get the expected URL of#/user/1/preferences
, which is good.See https://gist.run/?id=79ddeec65d8da990005115c73db970b1 for a simple reproduction.