import { RoutingContainer } from 'features/shared/components'
import { humanize } from 'utility/string'
+import { UTXOpageSize, pageSize } from 'utility/environment'
import actions from 'actions'
const makeRoutes = (store, type, List, New, Show, options = {}) => {
- const loadPage = () => {
- store.dispatch(actions[type].fetchAll())
+ const loadPage = ( state ) => {
+ if(type === 'transaction' || type === 'unspent'){
+ const query = state.location.query
+ const pageNumber = parseInt(state.location.query.page || 1)
+ const pageSizes = (type === 'unspent')? UTXOpageSize: pageSize
+ if (pageNumber == 1) {
+ store.dispatch(actions[type].fetchPage(query, pageNumber, { refresh: true, pageSize: pageSizes }))
+ } else {
+ store.dispatch(actions[type].fetchPage(query, pageNumber, { pageSize: pageSizes }))
+ }
+ }else{
+ store.dispatch(actions[type].fetchAll())
+ }
}
const childRoutes = []