mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-16 21:00:31 +00:00
fix items connector.
This commit is contained in:
@@ -5,43 +5,34 @@ import DashboardConnect from 'connectors/Dashboard.connector';
|
||||
import ItemForm from 'components/Items/ItemForm';
|
||||
import DashboardInsider from 'components/Dashboard/DashboardInsider';
|
||||
import ItemsConnect from 'connectors/Items.connect';
|
||||
import AccountsConnect from 'connectors/Accounts.connector';
|
||||
import { compose } from 'utils';
|
||||
|
||||
const ItemFormContainer = ({
|
||||
changePageTitle,
|
||||
fetchAccount,
|
||||
submitItem,
|
||||
editItem,
|
||||
fetchItems,
|
||||
fetchItem,
|
||||
deleteItem,
|
||||
accounts
|
||||
fetchAccounts,
|
||||
}) => {
|
||||
const { id } = useParams();
|
||||
useEffect(() => {
|
||||
id ? changePageTitle('Edit Item Details') : changePageTitle('New Item');
|
||||
id ?
|
||||
changePageTitle('Edit Item Details') :
|
||||
changePageTitle('New Item');
|
||||
}, []);
|
||||
|
||||
const fetchHook = useAsync(async () => {
|
||||
await Promise.all([fetchAccount()]);
|
||||
await Promise.all([
|
||||
fetchAccounts(),
|
||||
]);
|
||||
});
|
||||
return (
|
||||
<DashboardInsider isLoading={fetchHook.loading} name={'expense-form'}>
|
||||
<ItemForm
|
||||
{...{
|
||||
submitItem,
|
||||
editItem,
|
||||
fetchItem,
|
||||
fetchItems,
|
||||
deleteItem,
|
||||
accounts
|
||||
}}
|
||||
/>
|
||||
<DashboardInsider isLoading={fetchHook.loading} name={'item-form'}>
|
||||
<ItemForm />
|
||||
</DashboardInsider>
|
||||
);
|
||||
};
|
||||
|
||||
export default compose(
|
||||
DashboardConnect,
|
||||
ItemsConnect
|
||||
// AccountsConnect
|
||||
ItemsConnect,
|
||||
AccountsConnect,
|
||||
)(ItemFormContainer);
|
||||
|
||||
@@ -19,7 +19,7 @@ import Icon from 'components/Icon';
|
||||
import {handleBooleanChange} from 'utils';
|
||||
|
||||
const ItemsDataTable = ({
|
||||
fetchItems,
|
||||
requestFetchItems,
|
||||
filterConditions,
|
||||
currentPageItems,
|
||||
onEditItem,
|
||||
@@ -31,7 +31,7 @@ const ItemsDataTable = ({
|
||||
|
||||
const fetchHook = useAsync(async () => {
|
||||
await Promise.all([
|
||||
fetchItems({
|
||||
requestFetchItems({
|
||||
custom_view_id: customViewId,
|
||||
stringified_filter_roles: JSON.stringify(filterConditions),
|
||||
}),
|
||||
|
||||
Reference in New Issue
Block a user