emberjs / emberjs/ember.js

router.urlFor does not serialize nested query params

Open
#19,791 7 comments 3 reactions 0 assignees View on GitHub
enhancement Routing
Dominant language
TypeScript
Stars
22.6k
Forks
4.2k
Avg merge
3d 12h
Merged PRs (30d)
15

Description

### 🐞 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: -

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.