pagination count fix on change page size

This commit is contained in:
2022-02-10 17:06:51 +00:00
parent 4ae5f93e48
commit d59b59c016
8 changed files with 149 additions and 40 deletions
+8 -2
View File
@@ -9,6 +9,7 @@ import PaginationControl from "./pagination";
import LoadingOverlay from "react-loading-overlay";
import CryptoJS from "crypto-js";
import { setCurrentPage } from "../../store/currentView/action";
import {
getBasicSearch,
getBasicSearchDetails,
@@ -38,6 +39,7 @@ const DocumentDetails = (props) => {
documentHistoryObj,
setDocumentDetails,
setDocumentHistory,
setCurrentPage,
} = props;
const router = useRouter();
@@ -65,10 +67,11 @@ const DocumentDetails = (props) => {
<div id="recordCountSelect" className="govuk-grid-row">
<div className="govuk-form-group">
<label className="govuk-label-s " htmlFor="sort">
Show
{t("search:searchresults-show-records-label-a")}
<select
onChange={(e) => {
setSelectedOption(e.target.value);
setCurrentPage(1);
}}
value={selectedOption}
className="govuk-select"
@@ -81,7 +84,7 @@ const DocumentDetails = (props) => {
<option value="30">30</option>
<option value="50">50</option>
</select>{" "}
records
{t("search:searchresults-show-records-label-b")}
</label>
</div>
</div>
@@ -489,6 +492,9 @@ const mapDispatchToProps = (dispatch) => {
setDocumentHistory: (historyObj) => {
dispatch(setDocumentHistory(historyObj));
},
setCurrentPage: (currentPage) => {
dispatch(setCurrentPage(currentPage));
},
};
};