feat: bill payment transactions.

This commit is contained in:
elforjani13
2021-11-15 21:43:39 +02:00
parent b32abc0417
commit 377fb07c70
6 changed files with 163 additions and 49 deletions

View File

@@ -178,3 +178,18 @@ export function useRefreshBills() {
},
};
}
export function useBillPaymentTransactions(id, props) {
return useRequestQuery(
[t.BILLS_PAYMENT_TRANSACTIONS, id],
{
method: 'get',
url: `purchases/bills/${id}/payment-transactions`,
},
{
select: (res) => res.data.data,
defaultData: [],
...props,
},
);
}

View File

@@ -30,6 +30,9 @@ const commonInvalidateQueries = (client) => {
// Invalidate the cashflow transactions.
client.invalidateQueries(t.CASH_FLOW_TRANSACTIONS);
client.invalidateQueries(t.CASHFLOW_ACCOUNT_TRANSACTIONS_INFINITY);
// Invalidate bills payment transactions.
client.invalidateQueries(t.BILLS_PAYMENT_TRANSACTIONS);
};
/**