mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-17 13:20:31 +00:00
feat: Pending bank transactions
This commit is contained in:
28
packages/webapp/src/hooks/query/bank-transaction.ts
Normal file
28
packages/webapp/src/hooks/query/bank-transaction.ts
Normal file
@@ -0,0 +1,28 @@
|
||||
// @ts-nocheck
|
||||
import { useQuery, UseQueryOptions, UseQueryResult } from 'react-query';
|
||||
import useApiRequest from '../useRequest';
|
||||
import { BANK_QUERY_KEY } from '@/constants/query-keys/banking';
|
||||
|
||||
interface GetBankRuleRes {}
|
||||
|
||||
/**
|
||||
* Retrieve the given bank rule.
|
||||
* @param {number} bankRuleId -
|
||||
* @param {UseQueryOptions<GetBankRuleRes, Error>} options -
|
||||
* @returns {UseQueryResult<GetBankRuleRes, Error>}
|
||||
*/
|
||||
export function usePendingBankAccountTransactions(
|
||||
bankRuleId: number,
|
||||
options?: UseQueryOptions<GetBankRuleRes, Error>,
|
||||
): UseQueryResult<GetBankRuleRes, Error> {
|
||||
const apiRequest = useApiRequest();
|
||||
|
||||
return useQuery<GetBankRuleRes, Error>(
|
||||
[BANK_QUERY_KEY.PENDING_BANK_ACCOUNT_TRANSACTIONS],
|
||||
() =>
|
||||
apiRequest
|
||||
.get(`/banking/bank_account/pending_transactions`)
|
||||
.then((res) => res.data),
|
||||
{ ...options },
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user