From adc95e8312f89b47463adbeafafa88bcd4f34295 Mon Sep 17 00:00:00 2001 From: Vasiliy Kislov <64303474+VKislov@users.noreply.github.com> Date: Thu, 8 Feb 2024 10:15:19 +0500 Subject: [PATCH] fix(condo): DOMA-8333 fix payments sum filtering by createdAt on MarketplacePaymentsContent (#4337) --- .../components/MarketplacePaymentsContent.tsx | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/apps/condo/domains/marketplace/components/MarketplacePaymentsContent.tsx b/apps/condo/domains/marketplace/components/MarketplacePaymentsContent.tsx index b7646114506..1b360b1b0cb 100644 --- a/apps/condo/domains/marketplace/components/MarketplacePaymentsContent.tsx +++ b/apps/condo/domains/marketplace/components/MarketplacePaymentsContent.tsx @@ -161,9 +161,21 @@ const MarketplacePaymentsTableContent = () => { fetchPolicy: 'network-only', }) - const { data: allPaymentsSum, loading: allPaymentsSumLoading } = usePaymentsSum({ ...invoiceOrganizationQuery, status_in: [PAYMENT_WITHDRAWN_STATUS, PAYMENT_DONE_STATUS] }) - const { data: donePaymentsSum, loading: donePaymentsSumLoading } = usePaymentsSum({ ...invoiceOrganizationQuery, status_in: [PAYMENT_DONE_STATUS] }) - const { data: withdrawnPaymentsSum, loading: withdrawnPaymentsSumLoading } = usePaymentsSum({ ...invoiceOrganizationQuery, status_in: [PAYMENT_WITHDRAWN_STATUS] }) + const { data: allPaymentsSum, loading: allPaymentsSumLoading } = usePaymentsSum({ + ...filtersToWhere(filters), + ...invoiceOrganizationQuery, + status_in: [PAYMENT_WITHDRAWN_STATUS, PAYMENT_DONE_STATUS], + }) + const { data: donePaymentsSum, loading: donePaymentsSumLoading } = usePaymentsSum({ + ...filtersToWhere(filters), + ...invoiceOrganizationQuery, + status_in: [PAYMENT_DONE_STATUS], + }) + const { data: withdrawnPaymentsSum, loading: withdrawnPaymentsSumLoading } = usePaymentsSum({ + ...filtersToWhere(filters), + ...invoiceOrganizationQuery, + status_in: [PAYMENT_WITHDRAWN_STATUS], + }) const [selectedRows, setSelectedRows] = useState([])