Hey everyone if someone can help with this query. Have a sorting panel for a website, one option of which is to switch from an auction to a buy now. This is implemented as such:
const handleChange = (option: string) => {
setSelectedVal(option);
const selectedOption = categoriseByOptions.find(
(item) => item.label === option
);
console.log(selectedOption);
selectedOption &&
setConfigureProps(
{
hitsPerPage: selectedOption.hitsPerPage,
filters: selectedOption.filter,
}
);
};
<Configure {...configureProps} attributesToHighlight={[]}></Configure>
So when a user clicks the button, it will apply appropriate filters to said page.
On the other page I’m using a .search on my client to get a multiquery result.
useEffect(() => {
const fetchData = async () => {
const { results } = await searchClient.search([
{
indexName: "",
params: {
hitsPerPage: 80,
filters: `ObjectType:LOT AND ParentCategory:"${parentCategory}"`,
distinct: true,
},
},
{
indexName: "",
params: {
hitsPerPage: 20,
filters: `ObjectType:SALE AND ParentCategory:"${parentCategory}"`,
optionalFilters: ``,
distinct: true,
},
},
]);
const lotResults = results[0].hits;
const saleResults = results[1].hits;
setSaleResults(saleResults);
setLotResults(lotResults);
};
fetchData();
},[parentCategory]);
However when im on this page using the results from this none of the filters are working from the configure props on the page. Is there a reason for this?
Thankyou!!