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

allow to use custom sort_by parameter in the request #164

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

foodelix-admin
Copy link

Change Summary

when using useConfigure hook from react-instantsearch-hooks-web it is now possible to put sort_by parameter under the additionalSearchParameters object

useConfigure({
//...other configurations
additionalSearchParameters: {
sort_by: your sort rules,
// for example you can use it like this
// sort_by: location(${activeSearchRegion?.lat}, ${activeSearchRegion?.lon}):asc,
},
})

PR Checklist

@jasonbosco
Copy link
Member

This should already work without the changes in this PR.

In this line notice how the existing code has snakeCasedAdditionalSearchParameters.sort_by. That just uses params.additionalSearchParameters.sort_by after accounting for collection specific parameters, case sensitivity, etc.

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

3 participants