const orders = useGetManagerOrders(
{
page: pagination.pageIndex + 1,
per_page: perPage,
status_id: statusId
},
{
query: {
queryKey: ['orders', pagination, statusId],
placeholderData: keepPreviousData,
initialData: initialData,
refetchOnMount: false
},
request: {
headers: {
Accept: 'application/json',
'Content-Type': 'application/json',
Authorization: `Bearer ${session?.token}`
}
}
}
);
const defaultData = React.useMemo(() => [], []);
const table = useReactTable({
columns,
data: orders.data?.data.data ?? defaultData,
rowCount: orders.data?.data?.meta?.total ?? 0,
state: {
pagination
},
onPaginationChange: setPagination,
getCoreRowModel: getCoreRowModel(),
manualPagination: true
});