diff --git a/src/components/query-search-list/query-search-list.js b/src/components/query-search-list/query-search-list.js index 685715b37..223fd12d0 100644 --- a/src/components/query-search-list/query-search-list.js +++ b/src/components/query-search-list/query-search-list.js @@ -53,10 +53,33 @@ const QuerySearchList = ({ if (!length) { return notFoundMessage; } - + /** + * main function for paggination + * now it's working for prev next buttons + * in commented code functionality for load more button + * which is already emplemented and working correctly + */ const getLoadMoreButton = () => { const isUnloadedPagesPresent = (totalLength !== length) && !(length % PAGE_SIZE); + return ( + <> + + {/* place for page counter */} + + + ); + /* if (isUnloadedPagesPresent) { return (
@@ -71,6 +94,7 @@ const QuerySearchList = ({ } return null; + */ }; return ( diff --git a/src/redux/reducers/packageTitles.js b/src/redux/reducers/packageTitles.js index a89eb6e17..8543fd0a3 100644 --- a/src/redux/reducers/packageTitles.js +++ b/src/redux/reducers/packageTitles.js @@ -29,7 +29,8 @@ const handlers = { isLoading: false, hasLoaded: true, hasFailed: false, - items: [...state.items, ...payload.data], + // just one change, it is set new collection to state after each *next-prev* click + items: [...payload.data], totalResults: payload.totalResults, }), [GET_PACKAGE_TITLES_FAILURE]: (state, action) => ({