Skip to content

router.urlFor does not serialize nested query params #19791

@snewcomer

Description

@snewcomer

🐞 Describe the Bug

this.router.urlFor('route-name', {
  filter: {
    user: {
      name: 'yay!'
    }
  }
});

Produces a url of ?filter=%5Bobject%20Object%5D.... Same issue with this.router.replaceWith and probably other methods

🔬 Minimal Reproduction

See tests here - https://github.com/emberjs/ember.js/blob/21bd70c773dcc4bfe4883d7943e8a68d203b5bad/packages/ember/tests/routing/router_service_test/urlFor_test.js

😕 Actual Behavior

?filter=%5Bobject%20Object%5D

🤔 Expected Behavior

?filter=[user][name]='yay!'

🌍 Environment

  • Ember: -
  • Node.js/npm: -
  • OS: -
  • Browser: -

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions