mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-17 05:10:31 +00:00
chrone: sperate client and server to different repos.
This commit is contained in:
14
src/containers/Users/withUsers.js
Normal file
14
src/containers/Users/withUsers.js
Normal file
@@ -0,0 +1,14 @@
|
||||
import { connect } from 'react-redux';
|
||||
import { getExpensesCurrentPageFactory } from 'store/users/users.selectors';
|
||||
|
||||
export default (mapState) => {
|
||||
const mapStateToProps = (state, props) => {
|
||||
const mapped = {
|
||||
usersList: getExpensesCurrentPageFactory(state, props),
|
||||
usersLoading: state.users.loading,
|
||||
};
|
||||
return mapState ? mapState(mapped, state, props) : mapped;
|
||||
};
|
||||
|
||||
return connect(mapStateToProps);
|
||||
};
|
||||
21
src/containers/Users/withUsersActions.js
Normal file
21
src/containers/Users/withUsersActions.js
Normal file
@@ -0,0 +1,21 @@
|
||||
import { connect } from 'react-redux';
|
||||
import {
|
||||
fetchUsers,
|
||||
fetchUser,
|
||||
deleteUser,
|
||||
inactiveUser,
|
||||
editUser,
|
||||
submitInvite
|
||||
} from 'store/users/users.actions';
|
||||
|
||||
export const mapDispatchToProps = (dispatch) => ({
|
||||
requestFetchUsers: () => dispatch(fetchUsers({})),
|
||||
requestFetchUser: (id) => dispatch(fetchUser({ id })),
|
||||
requestDeleteUser: (id) => dispatch(deleteUser({ id })),
|
||||
requestInactiveUser: (id) => dispatch(inactiveUser({ id })),
|
||||
requestEditUser: (id, form) => dispatch(editUser({ form, id })),
|
||||
requestSubmitInvite: (form) => dispatch(submitInvite({ form })),
|
||||
|
||||
});
|
||||
|
||||
export default connect(null, mapDispatchToProps);
|
||||
Reference in New Issue
Block a user