aurelia / router

A powerful client-side router.
MIT License
121 stars 115 forks source link

Parameters for parent route added to query instead #647

Open RomkeVdMeulen opened 4 years ago

RomkeVdMeulen commented 4 years ago

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.