feat: account drawer.

This commit is contained in:
elforjani3
2021-04-27 15:58:37 +02:00
parent 5bb31f783c
commit 5b62410afa
14 changed files with 437 additions and 12 deletions

View File

@@ -144,3 +144,19 @@ export function useInactivateAccount(props) {
...props,
});
}
/**
* Retrieve account transactions.
*/
export function useAccountTransactions(id, props) {
console.log(id, 'FF');
return useRequestQuery(
[t.ACCOUNT_TRANSACTION, id],
{ method: 'get', url: `accounts/transactions?account_id=${id}` },
{
select: (res) => res.data.transactions,
defaultData: [],
...props,
},
);
}

View File

@@ -1,5 +1,6 @@
const ACCOUNTS = {
ACCOUNT: 'ACCOUNT',
ACCOUNT_TRANSACTION: 'ACCOUNT_TRANSACTION',
ACCOUNTS: 'ACCOUNTS',
ACCOUNTS_TYPES: 'ACCOUNTS_TYPES',
};
@@ -126,5 +127,5 @@ export default {
...ORGANIZATIONS,
...SUBSCRIPTIONS,
...EXPENSES,
...MANUAL_JOURNALS
...MANUAL_JOURNALS,
};