Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parameters for parent route added to query instead #647

Open
RomkeVdMeulen opened this issue Aug 1, 2019 · 0 comments
Open

Parameters for parent route added to query instead #647

RomkeVdMeulen opened this issue Aug 1, 2019 · 0 comments

Comments

@RomkeVdMeulen
Copy link

I'm submitting a bug report

  • Library Version:
    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.

  • What is the expected behavior?
    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.

@RomkeVdMeulen RomkeVdMeulen changed the title Parameters for parent route also added to query Parameters for parent route added to query in stead Aug 1, 2019
@RomkeVdMeulen RomkeVdMeulen changed the title Parameters for parent route added to query in stead Parameters for parent route added to query instead Aug 1, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant