dual-salmonD
Refine15mo ago
5 replies
dual-salmon

trying to filter resource by dates through api

i have resource orders, that is taken from my backend api
i am trying to pass two dates so that api only extract orders within this period of time. I pass them through meta parameters and it works

const { tableProps, setFilters } = useTable<InterfaceOrders>({
        resource: "orders",
        pagination: { mode: "server", current: 1, pageSize: 10 },
        sorters: {
            initial: [{ field: "createdAt", order: "desc" }]
        },
        syncWithLocation: true,
        meta: {
            searchFrom: dayjs().startOf('day').format("YYYY-MM-DDTHH:mm:ss"),
            searchTill: dayjs().endOf('day').format("YYYY-MM-DDTHH:mm:ss")
        }
    });


now i want to create a date picker to choose dates and refetch with those dates, how do i refresh meta parameters?
Was this page helpful?