Fix: Exchange Rate Pageination

This commit is contained in:
elforjani3
2020-11-02 15:57:25 +02:00
parent 9a38559b98
commit 28fe1c25e6
6 changed files with 136 additions and 17 deletions

View File

@@ -1,11 +1,24 @@
import { connect } from 'react-redux';
import { getExchangeRatesList } from 'store/ExchangeRate/exchange.selector';
import {
getExchangeRatesList,
getExchangeRatePaginationMetaFactory,
getExchangeRatesTableQueryFactory,
} from 'store/ExchangeRate/exchange.selector';
export default (mapState) => {
const getExchangeRatesPaginationMeta = getExchangeRatePaginationMetaFactory();
const mapStateToProps = (state, props) => {
const query = getExchangeRatesTableQueryFactory(state, props);
const mapped = {
exchangeRatesList: getExchangeRatesList(state, props),
exchangeRatesLoading: state.exchangeRates.loading,
exchangeRatesPageination: getExchangeRatesPaginationMeta(
state,
props,
query,
),
};
return mapState ? mapState(mapped, state, props) : mapped;
};