feat: add due bills reducer and selector.

This commit is contained in:
Ahmed Bouhuolia
2020-10-28 18:29:51 +02:00
parent bc9638c9a2
commit 8a20deacf3
6 changed files with 64 additions and 1 deletions

View File

@@ -4,12 +4,14 @@ import {
getBillCurrentPageFactory,
getBillPaginationMetaFactory,
getBillTableQueryFactory,
getVendorDueBillsFactory
} from 'store/Bills/bills.selectors';
export default (mapState) => {
const getBillsItems = getBillCurrentPageFactory();
const getBillsPaginationMeta = getBillPaginationMetaFactory();
const getBillTableQuery = getBillTableQueryFactory();
const getVendorDueBills = getVendorDueBillsFactory();
const mapStateToProps = (state, props) => {
const tableQuery = getBillTableQuery(state, props);
@@ -23,6 +25,8 @@ export default (mapState) => {
billsPageination: getBillsPaginationMeta(state, props, tableQuery),
billsLoading: state.bills.loading,
nextBillNumberChanged: state.bills.nextBillNumberChanged,
vendorDueBills: getVendorDueBills(state, props),
};
return mapState ? mapState(mapped, state, props) : mapped;
};