-
Notifications
You must be signed in to change notification settings - Fork 26.2k
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
Merge url query with exportPathMap #4678
Merge url query with exportPathMap #4678
Conversation
server/index.js
Outdated
.filter(key => query[key] === undefined) | ||
.forEach(key => console.warn(`Url defines a query parameter '${key}' that is missing in exportPathMap`)) | ||
|
||
const mergedQuery = Object.assign({}, urlQuery, query) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's do {...urlQuery, ...query}
instead of Object.assign
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's add a test for this new behavior 👍 can be added in test/integration/export
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My review was actually a request changes
I actually gave the wrong directory, |
@timneutkens I added the tests for the 3 scenario in the PR's description. I ran into the following problems while writing the tests : 1.
|
@timneutkens Oh, but |
You actually don't have to test the console.log calls, just check loading the page with a querystring and |
I fixed the tests, I removed the test for console.log. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great 👍
This PR fixes #4615
From the issue :
The behaviour after this PR is the following :
ctx.query
/
{ a: 'blue' }
/?a=red
{ a: 'blue' }
/?b=green
{ a: 'blue', b: 'green' }
... parameter 'b' missing in exportPathMap
Is that the expected behaviour ? If not, I'll update the PR to shape the expected behavior.