diff --git a/src/client/epics/index.js b/src/client/epics/index.js index d37b12fa4d8d6524749c2869f78517c927126bfa..8615217615b38c4a0ef6b0496a99127e0fabc920 100644 --- a/src/client/epics/index.js +++ b/src/client/epics/index.js @@ -77,10 +77,10 @@ const fetchPaginatedResultsEpic = (action$, state$) => action$.pipe( const params = stateToUrl({ facets: state[`${facetClass}Facets`].facets, facetClass: null, - page: page, - pagesize: pagesize, - sortBy: sortBy, - sortDirection: sortDirection + page, + pagesize, + sortBy, + sortDirection }) const requestUrl = `${apiUrl}/faceted-search/${resultClass}/paginated` // https://rxjs-dev.firebaseapp.com/api/ajax/ajax diff --git a/src/client/helpers/helpers.js b/src/client/helpers/helpers.js index 0ac74f64913df1d1b0921125876011300ad08c39..8865d9a4f1b24aa3364289d5d62b031686830d7e 100644 --- a/src/client/helpers/helpers.js +++ b/src/client/helpers/helpers.js @@ -21,7 +21,7 @@ export const stateToUrl = ({ const params = {} if (facetClass !== null) { params.facetClass = facetClass } if (page !== null) { params.page = page } - if (pagesize !== null) { params.pagesize = pagesize } + if (pagesize !== null) { params.pagesize = parseInt(pagesize) } if (sortBy !== null) { params.sortBy = sortBy } if (sortDirection !== null) { params.sortDirection = sortDirection } if (resultFormat !== null) { params.resultFormat = resultFormat } @@ -123,7 +123,7 @@ export const handleAxiosError = error => { export const pickSelectedDatasets = datasets => { const selected = [] - Object.keys(datasets).map(key => { + Object.keys(datasets).forEach(key => { if (datasets[key].selected) { selected.push(key) }