-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
Encapsulate query strings #3687
Conversation
…ery-string module
client/app/services/query.js
Outdated
} | ||
|
||
return qs.toString(Object.assign(...this.get().map(p => p.toUrlParams()))); | ||
return qs.toString(this.getValues()); |
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.
I think it's better to use param.toUrlParams()
instead of mapping name => value
directly - it provides some layer of abstraction for a case when param will need some different serialization logic in future.
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.
What I'm trying to achieve with this refactoring is moving out the serialization logic from Parameter
/Parameters
and into the query string module. The approach here is that a query string is itself the serialization "view", thus the logic resides there and the model simply reveals its data.
This is no longer needed, right? |
@arikfr it was never needed, but I guess at this point it'll be better to revisit this at |
What type of PR is this? (check all applicable)
Description
Related Tickets & Documents
Mobile & Desktop Screenshots/Recordings (if there are UI changes)