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

Make Searches Filterable #232

Merged
merged 2 commits into from
Jan 20, 2024
Merged

Make Searches Filterable #232

merged 2 commits into from
Jan 20, 2024

Conversation

confused-Techie
Copy link
Member

Requirements

  • Filling out the template is required.

  • All new code requires tests to ensure against regressions.

    • However, if your PR contains zero code changes, feel free to select the checkmark below to indicate so.
  • Have you ran tests against this code?

  • This PR contains zero code changes.

Description of the Change

This PR introduces the ability to utilize all valid query parameters of /api/packages on /api/packages/search.

This now means you can search for a package name while also:

  • Showing results that support a specific file extension
  • Showing results that are either consumers or providers of a specific service
  • Showing results that are consumers or providers of a specific service and version
  • Showing results results of a specific owner

While of course still being able to:

  • Sort the packages in the desired direction
  • Get the specific page
  • Sort the packages in a particular direction

Of course, if preferred, you are still able to get a full list of packages without any search.

This means this is a fully backwards compatible method of adding far more capabilities to the package searching.


Technical Notes:

  • This PR expands the work done by @savetheclocktower of utilizing _Clause() functions within getSortedPackages() to elegantly and easily extend the accepted functionality of the function. Using this I was able to add the query query parameter to the function.
  • As it's no longer used the original simpleSearch() function has been removed in favour of getSortedPackages().

Closes #214

@confused-Techie confused-Techie merged commit 4a320aa into main Jan 20, 2024
6 checks passed
@confused-Techie confused-Techie deleted the combine-filter-and-search branch January 20, 2024 02:08
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.

Fix inability to search and filter packages at the same time
1 participant