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
View File
@@ -6,6 +6,7 @@ export const currentViewActionTypes = {
SETREPRESENTATIONSUBMIT: "SETREPRESENTATIONSUBMIT",
SETREPRESENTATIONSUBMITCONFIRMATION: "SETREPRESENTATIONSUBMITCONFIRMATION",
SETCURRENTLINKEDCASES: "SETCURRENTLINKEDCASES",
SETCURRENTPAGE: "SETCURRENTPAGE",
};
export const getCurrentViewObj = () => (dispatch) => {
@@ -64,3 +65,10 @@ export const setCurrentLinkedCases = (linkedCaseReferences) => (dispatch) => {
linkedCaseReferences: linkedCaseReferences,
});
};
export const setCurrentPage = (currentPage) => (dispatch) => {
return dispatch({
type: currentViewActionTypes.SETCURRENTPAGE,
currentPage: currentPage,
});
};
+6
View File
@@ -7,6 +7,7 @@ const currentViewInitialState = {
representationSubmit: null,
representationSubmitConfirmation: {},
linkedCaseReferences: {},
currentPage: 1,
};
export default function reducer(state = currentViewInitialState, action) {
@@ -38,6 +39,11 @@ export default function reducer(state = currentViewInitialState, action) {
representationSubmitConfirmation:
action.representationSubmitConfirmation,
};
case currentViewActionTypes.SETCURRENTPAGE:
return {
...state,
currentPage: action.currentPage,
};
default:
return state;
}