inveniosoftware / react-searchkit

React component library for interacting with a REST API.
https://inveniosoftware.github.io/react-searchkit/
MIT License
78 stars 40 forks source link

Add "hidden" filters/params #130

Closed slint closed 4 years ago

slint commented 4 years ago

There are search page use cases that require a specific query string parameter to be passed to the underlying REST API request, but at the same time not to be serialized/updated in the URL.

A quick example is having a "Pending members" search page at /members/pending, that hits /api/members?status=pending, and allows other standard filters/queries. The top-bar URL doesn't really need the status=pending parameter to be displayed, but it has to be kept somehow in the query state.

To properly facilitate this feature, we would need to add a query.hidden_filters key in the store (along with the appropriate reducers/actions/etc.), which can be also initialized accordingly via config. This value can then be used in the underlying search API class to be injected into the request.