I think the problem is that you're not explicitly return
ing your values. You should explicitly add the return
statement:
beforeSearchCall: (options, next) => {
console.log('queryoptions', options);
if(!countrySelected&&!languageSelected)
return next({
...options,
filters: [
{
field: 'regioncountrylist',
values: [countrySelected],
type: 'any',
},
{
field: 'language',
values: [languageSelected],
type: 'any'
}
]
})
Have a look at other options for achieving this in this post.