You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
1.7.1
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.Parameters that match path parameters should be used in that path and not be added to the query string.
See https://gist.run/?id=79ddeec65d8da990005115c73db970b1 for a simple reproduction.
The text was updated successfully, but these errors were encountered: