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

fix(search): omit most params in querystring if default #449

Merged
merged 1 commit into from
Aug 21, 2020

Conversation

LoneRifle
Copy link
Contributor

Problem

Closes #323

Solution

  • copy newParams in redirectWithParams(), ensuring that query
    is always populated
  • for each param in newParams, if its value differs from default,
    populate in the copy. This results in an object omitting defaults
    from the querystring

Before & After Screenshots

image

- copy newParams in redirectWithParams, ensuring that query
  is always populated
- for each param in newParams, if its value differs from default,
  populate in the copy. This results in an object omitting defaults
  from the querystring
@LoneRifle LoneRifle requested a review from yong-jie August 20, 2020 02:01
Copy link
Member

@yong-jie yong-jie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@LoneRifle LoneRifle merged commit 4b76835 into develop Aug 21, 2020
@LoneRifle LoneRifle deleted the fix/search/omit-default-qs branch August 21, 2020 03:05
xming13 pushed a commit to xming13/GoGovSG that referenced this pull request Aug 21, 2020
- copy newParams in redirectWithParams, ensuring that query
  is always populated
- for each param in newParams, if its value differs from default,
  populate in the copy. This results in an object omitting defaults
  from the querystring
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

Successfully merging this pull request may close these issues.

Keep search query parameters short in URL
2 participants