Explorar o código

rtk_pagin_orders

Gennadysht %!s(int64=2) %!d(string=hai) anos
pai
achega
05000b816d
Modificáronse 2 ficheiros con 6 adicións e 3 borrados
  1. 4 1
      src/Components/Pagination.js
  2. 2 2
      src/reducers/frontEndReducer.js

+ 4 - 1
src/Components/Pagination.js

@@ -31,7 +31,10 @@ export const COrdersPagination = () => {
     let allEntitiesCount = getOrdersCount(state);
     let dispatch = useDispatch();
     let changePageFE = (fromPage) => dispatch(actionSetOrdersPaging({ fromPage }));
-    let changeRowsPerPageFE = pageSize => dispatch(actionSetOrdersPaging({ fromPage: 0, pageSize }));
+    let changeRowsPerPageFE = pageSize => {
+        let a = '';
+        dispatch(actionSetOrdersPaging({ fromPage: 0, pageSize }));
+    }
     let fromPage = state.frontend.ordersPaging.fromPage;
     const pageSize = state.frontend.ordersPaging.pageSize;
     return <Pagination allEntitiesCount={allEntitiesCount} fromPage={fromPage} pageSize={pageSize} changePageFE={changePageFE} changeRowsPerPageFE={changeRowsPerPageFE} />

+ 2 - 2
src/reducers/frontEndReducer.js

@@ -19,8 +19,8 @@ const frontEndReducerSlice = createSlice({ //promiseReducer
         },
         setOrdersPaging(state, action) {
             let { fromPage, pageSize } = action.payload.page;
-            fromPage = fromPage ?? state.goodsPaging?.fromPage;
-            pageSize = pageSize ?? state.goodsPaging?.pageSize;
+            fromPage = fromPage ?? state.ordersPaging?.fromPage;
+            pageSize = pageSize ?? state.ordersPaging?.pageSize;
             state.ordersPaging = { fromPage, pageSize };
             return state;
         },