This commit is contained in:
Ahmed Bouhuolia
2020-03-16 00:06:15 +02:00
parent 56701951b7
commit 73711384f6
7925 changed files with 18478 additions and 959 deletions

View File

@@ -0,0 +1,39 @@
import { connect } from 'react-redux';
import {useParams} from 'react-router-dom';
import t from 'store/types';
import {
fetchAccountTypes,
fetchAccountsList,
deleteAccount,
inactiveAccount,
} from 'store/accounts/accounts.actions';
import {
getAccountsItems,
} from 'store/accounts/accounts.selectors';
import {
getResourceViews,
} from 'store/customViews/customViews.selectors';
const mapStateToProps = (state, props) => ({
views: getResourceViews(state, 'accounts'),
accounts: getAccountsItems(state, state.accounts.currentViewId),
});
const mapActionsToProps = (dispatch) => ({
fetchAccounts: (query) => dispatch(fetchAccountsList({ query })),
fetchAccountTypes: () => dispatch(fetchAccountTypes()),
deleteAccount: (id) => dispatch(deleteAccount({ id })),
inactiveAccount: (id) => dispatch(inactiveAccount({ id })),
addBulkActionAccount: (id) => dispatch({
type: t.ACCOUNT_BULK_ACTION_ADD, account_id: id
}),
removeBulkActionAccount: (id) => dispatch({
type: t.ACCOUNT_BULK_ACTION_REMOVE, account_id: id,
}),
changeCurrentView: (id) => dispatch({
type: t.ACCOUNTS_SET_CURRENT_VIEW,
currentViewId: parseInt(id, 10),
}),
});
export default connect(mapStateToProps, mapActionsToProps);