incredible-moccasinI
Refine2y ago
25 replies
incredible-moccasin

useList or operator is not working

I have this query for global search but the or operator is returning nothing. I'm using supabase as dataProvider

const { refetch: refetchOrders } = useList<any>({
resource: "contacts",
filters: [
{
operator: "or",
value: [
{
field: "firstname",
operator: "contains",
value: value,
},
{
field: "lastname",
operator: "contains",
value: value,
},
],
},
],
queryOptions: {
enabled: false,
onSuccess: (data) => {
const orderOptionGroup = data.data.map((item) =>
renderItem(
#${item.id} - ${item.firstname} ${item.lastname},
/contacts/show/${item.id}
)
);
if (orderOptionGroup.length > 0) {
setOptions((prevOptions) => [
...prevOptions,
{
label: renderTitle("Contacts"),
options: orderOptionGroup,
},
]);
}
},
},
});
Was this page helpful?