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 issue #5331. #5332

Merged
merged 14 commits into from May 3, 2021
Merged

Fix issue #5331. #5332

merged 14 commits into from May 3, 2021

Conversation

mwu2018
Copy link
Contributor

@mwu2018 mwu2018 commented Mar 17, 2021

What this PR does

Fixes #5331

Checklist

  • There are unit tests to verify my changes are correct or unit tests aren't applicable (if so, write quick reason why unit tests don't exist)
  • I've updated CHANGES.md with what I changed.

@mwu2018 mwu2018 marked this pull request as ready for review March 17, 2021 01:24
@mwu2018 mwu2018 requested a review from nf-s March 17, 2021 01:25
@nf-s nf-s self-assigned this Mar 17, 2021
lib/Models/CkanCatalogGroup.ts Outdated Show resolved Hide resolved
uri.addQuery(key, filterQuery[key])
);
if (typeof filterQuery === "string") {
uri.query(uri.query() + "&" + filterQuery.toString());
Copy link
Contributor

Choose a reason for hiding this comment

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

Looks good @mwu2018
Sorry to nitpick, but is it possible to use uri.addQuery() instead of uri.query(uri.query() + ...?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@nf-s You did not nitpick at all. Instead, you have opened a can of worms 😃

  1. The filterQuery trait is changed similar to what you suggested initially. Your later suggestion does not allow mixed elements in the array.
  2. We can not use uri.addQuery(filterQuery) because the URI encoder will escape =, which is not what we want. I have added some comments in the code.
  3. The code is slightly refactored in order to do simple unit tests.

Can you please take another look?

@nf-s nf-s merged commit 83ce629 into next May 3, 2021
@nf-s nf-s deleted the fix-ckan-group-bug branch May 3, 2021 05:00
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.

None yet

2 participants