mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-18 13:50:31 +00:00
WIP / Feature & Fix Expense /Customer
This commit is contained in:
@@ -14,6 +14,7 @@ import { compose } from 'utils';
|
||||
function Expenses({
|
||||
// #withwithAccountsActions
|
||||
requestFetchAccounts,
|
||||
requestFetchAccountTypes,
|
||||
|
||||
// #withExpensesActions
|
||||
requestFetchExpense,
|
||||
@@ -24,18 +25,15 @@ function Expenses({
|
||||
const history = useHistory();
|
||||
const { id } = useParams();
|
||||
|
||||
// @todo
|
||||
const fetchAccounts = useQuery('accounts-expense-list', (key) =>
|
||||
const fetchAccounts = useQuery('accounts-list', (key) =>
|
||||
requestFetchAccounts(),
|
||||
);
|
||||
|
||||
// @todo
|
||||
const fetchExpense = useQuery(id && ['expense', id], (key, expense_Id) =>
|
||||
requestFetchExpense(expense_Id),
|
||||
);
|
||||
|
||||
// @todo
|
||||
const fetchCurrencies = useQuery('currencies-expense-list', () =>
|
||||
const fetchCurrencies = useQuery('currencies', () =>
|
||||
requestFetchCurrencies(),
|
||||
);
|
||||
const handleFormSubmit = useCallback(
|
||||
@@ -46,7 +44,7 @@ function Expenses({
|
||||
);
|
||||
|
||||
const handleCancel = useCallback(() => {
|
||||
history.push('/expenses-list');
|
||||
history.goBack();
|
||||
}, [history]);
|
||||
|
||||
return (
|
||||
@@ -56,6 +54,7 @@ function Expenses({
|
||||
fetchAccounts.isFetching ||
|
||||
fetchCurrencies.isFetching
|
||||
}
|
||||
name={'expense-form'}
|
||||
>
|
||||
<ExpenseForm
|
||||
onFormSubmit={handleFormSubmit}
|
||||
|
||||
Reference in New Issue
Block a user