From c9f36aeb1e564606733d688979172e80b38d8d4d Mon Sep 17 00:00:00 2001 From: Umar Adilov <99314948+adilovcode@users.noreply.github.com> Date: Fri, 2 May 2025 23:31:36 +0500 Subject: [PATCH] Fixed type issues --- src/widgets/transactions-table.tsx | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/widgets/transactions-table.tsx b/src/widgets/transactions-table.tsx index 993ac00..eff0c34 100644 --- a/src/widgets/transactions-table.tsx +++ b/src/widgets/transactions-table.tsx @@ -26,14 +26,16 @@ import { } from '@/shared/shadcn-ui/table'; export const TransactionsTable = () => { - const [startDate, setStartDate] = useState(subMonths(new Date(), 1)); - const [endDate, setEndDate] = useState(new Date()); + const [startDate, setStartDate] = useState( + subMonths(new Date(), 1), + ); + const [endDate, setEndDate] = useState(new Date()); const { data, refetch } = useFetchBonusTransactionsQuery({ limit: 100, page: 1, - start_date: format(startDate, 'yyyy-MM-dd'), - end_date: format(endDate, 'yyyy-MM-dd'), + ...(startDate ? { start_date: format(startDate, 'yyyy-MM-dd') } : {}), + ...(endDate ? { end_date: format(endDate, 'yyyy-MM-dd') } : {}), }); // Filter transactions by date range