mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-19 06:10:31 +00:00
feat: get bank account meta summary
This commit is contained in:
@@ -4,6 +4,7 @@ import { useParams } from 'react-router-dom';
|
||||
import { DashboardInsider } from '@/components';
|
||||
import { useCashflowAccounts, useAccount } from '@/hooks/query';
|
||||
import { useAppQueryString } from '@/hooks';
|
||||
import { useGetBankAccountSummaryMeta } from '@/hooks/query/bank-rules';
|
||||
|
||||
const AccountTransactionsContext = React.createContext();
|
||||
|
||||
@@ -20,31 +21,38 @@ function AccountTransactionsProvider({ query, ...props }) {
|
||||
const setFilterTab = (value: string) => {
|
||||
setLocationQuery({ filter: value });
|
||||
};
|
||||
// Fetch cashflow accounts.
|
||||
// Retrieves cashflow accounts.
|
||||
const {
|
||||
data: cashflowAccounts,
|
||||
isFetching: isCashFlowAccountsFetching,
|
||||
isLoading: isCashFlowAccountsLoading,
|
||||
} = useCashflowAccounts(query, { keepPreviousData: true });
|
||||
|
||||
// Retrieve specific account details.
|
||||
|
||||
// Retrieves specific account details.
|
||||
const {
|
||||
data: currentAccount,
|
||||
isFetching: isCurrentAccountFetching,
|
||||
isLoading: isCurrentAccountLoading,
|
||||
} = useAccount(accountId, { keepPreviousData: true });
|
||||
|
||||
// Retrieves the bank account meta summary.
|
||||
const {
|
||||
data: bankAccountMetaSummary,
|
||||
isLoading: isBankAccountMetaSummaryLoading,
|
||||
} = useGetBankAccountSummaryMeta(accountId);
|
||||
|
||||
// Provider payload.
|
||||
const provider = {
|
||||
accountId,
|
||||
cashflowAccounts,
|
||||
currentAccount,
|
||||
bankAccountMetaSummary,
|
||||
|
||||
isCashFlowAccountsFetching,
|
||||
isCashFlowAccountsLoading,
|
||||
isCurrentAccountFetching,
|
||||
isCurrentAccountLoading,
|
||||
isBankAccountMetaSummaryLoading,
|
||||
|
||||
filterTab,
|
||||
setFilterTab,
|
||||
|
||||
Reference in New Issue
Block a user