mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-19 22:30:31 +00:00
Fix : Customers
This commit is contained in:
@@ -1,17 +1,27 @@
|
||||
import { connect } from 'react-redux';
|
||||
import { getCustomersItems, getCustomersListFactory } from 'store/customers/customers.selectors';
|
||||
import { getResourceViews } from 'store/customViews/customViews.selectors';
|
||||
import {
|
||||
getCustomerCurrentPageFactory,
|
||||
getCustomerPaginationMetaFactory,
|
||||
getCustomerTableQueryFactory,
|
||||
} from 'store/customers/customers.selectors';
|
||||
|
||||
export default (mapState) => {
|
||||
const getCustomersList = getCustomersListFactory();
|
||||
const getCustomersList = getCustomerCurrentPageFactory();
|
||||
const getCustomerPaginationMeta = getCustomerPaginationMetaFactory();
|
||||
const getCustomerTableQuery = getCustomerTableQueryFactory();
|
||||
|
||||
const mapStateToProps = (state, props) => {
|
||||
const query = getCustomerTableQuery(state, props);
|
||||
|
||||
const mapped = {
|
||||
customers: getCustomersList(state, props, query),
|
||||
customersViews: getResourceViews(state, props, 'customers'),
|
||||
customersItems: getCustomersList(state, props),
|
||||
customers: getCustomersItems(state, state.customers.currentViewId),
|
||||
customersTableQuery: query,
|
||||
customerPagination: getCustomerPaginationMeta(state, props, query),
|
||||
customersLoading: state.customers.loading,
|
||||
customerErrors: state.customers.errors,
|
||||
customersItems: state.customers.items,
|
||||
// customerErrors: state.customers.errors,
|
||||
};
|
||||
return mapState ? mapState(mapped, state, props) : mapped;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user