mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-16 12:50:38 +00:00
re-structure to monorepo.
This commit is contained in:
15
packages/webapp/src/containers/Users/withUsers.tsx
Normal file
15
packages/webapp/src/containers/Users/withUsers.tsx
Normal file
@@ -0,0 +1,15 @@
|
||||
// @ts-nocheck
|
||||
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);
|
||||
};
|
||||
22
packages/webapp/src/containers/Users/withUsersActions.tsx
Normal file
22
packages/webapp/src/containers/Users/withUsersActions.tsx
Normal file
@@ -0,0 +1,22 @@
|
||||
// @ts-nocheck
|
||||
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