inveniosoftware/react-searchkit

Add "hidden" filters/params

Closed this issue · 0 comments

slint commented

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.