Browse Source

rename actions actionAdmin -> action

ilya_shyian 2 years ago
parent
commit
daf2956daa
41 changed files with 132 additions and 133 deletions
  1. 0 8
      src/actions/actionAdminCategoryPageClear.js
  2. 0 7
      src/actions/actionAdminGoodPageClear.js
  3. 0 8
      src/actions/actionAdminOrderPageClear.js
  4. 0 16
      src/actions/actionAdminUserPage.js
  5. 0 6
      src/actions/actionAdminUserPageClear.js
  6. 2 2
      src/actions/actionAdminCategoriesPage.js
  7. 1 1
      src/actions/actionAdminCategoriesPageClear.js
  8. 3 3
      src/actions/actionAdminCategoriesSearchPage.js
  9. 1 2
      src/actions/actionAdminCategoriesSearchPageClear.js
  10. 4 4
      src/actions/actionAdminCategoryPage.js
  11. 9 0
      src/actions/actionCategoryPageClear.js
  12. 4 4
      src/actions/actionAdminGoodPage.js
  13. 9 0
      src/actions/actionGoodPageClear.js
  14. 1 2
      src/actions/actionAdminGoodsPage.js
  15. 1 1
      src/actions/actionAdminGoodsPageClear.js
  16. 1 1
      src/actions/actionAdminGoodsSearchPage.js
  17. 1 1
      src/actions/actionAdminGoodsSearchPageClear.js
  18. 4 4
      src/actions/actionAdminOrderPage.js
  19. 10 0
      src/actions/actionOrderPageClear.js
  20. 2 3
      src/actions/actionAdminOrdersPage.js
  21. 1 2
      src/actions/actionAdminOrdersPageClear.js
  22. 2 2
      src/actions/actionAdminOrdersSearchPage.js
  23. 1 1
      src/actions/actionAdminOrdersSearchPageClear.js
  24. 13 0
      src/actions/actionUserPage.js
  25. 8 0
      src/actions/actionUserPageClear.js
  26. 3 3
      src/actions/actionAdminUsersPage.js
  27. 1 2
      src/actions/actionAdminUsersPageClear.js
  28. 2 2
      src/actions/actionAdminUsersSearchPage.js
  29. 1 1
      src/actions/actionAdminUsersSearchPageClear.js
  30. 4 4
      src/components/admin/AdminLayoutPage/AdminCategoryLayout/AdminCategoriesPageContainer.js
  31. 4 4
      src/components/admin/AdminLayoutPage/AdminCategoryLayout/AdminCategoriesSearchPageContainer.js
  32. 4 4
      src/components/admin/AdminLayoutPage/AdminCategoryLayout/AdminCategoryPageContainer.js
  33. 4 4
      src/components/admin/AdminLayoutPage/AdminGoodLayout/AdminGoodPageContainer.js
  34. 4 4
      src/components/admin/AdminLayoutPage/AdminGoodLayout/AdminGoodsPageContainer.js
  35. 4 4
      src/components/admin/AdminLayoutPage/AdminGoodLayout/AdminGoodsSearchPageContainer.js
  36. 4 4
      src/components/admin/AdminLayoutPage/AdminOrderLayout/AdminOrderPageContainer.js
  37. 4 4
      src/components/admin/AdminLayoutPage/AdminOrderLayout/AdminOrdersPageContainer.js
  38. 3 3
      src/components/admin/AdminLayoutPage/AdminOrderLayout/AdminOrdersSearchPageContainer.js
  39. 4 4
      src/components/admin/AdminLayoutPage/AdminUserLayout/AdminUserPageContainer.js
  40. 4 4
      src/components/admin/AdminLayoutPage/AdminUserLayout/AdminUsersPageContainer.js
  41. 4 4
      src/components/admin/AdminLayoutPage/AdminUserLayout/AdminUsersSearchPageContainer.js

+ 0 - 8
src/actions/actionAdminCategoryPageClear.js

@@ -1,8 +0,0 @@
-import { actionPromiseClear } from "../reducers";
-
-export const actionAdminCategoryPageClear = () => async (dispatch, getState) => {
-    dispatch(actionPromiseClear("goodsAll"));
-    dispatch(actionPromiseClear("adminCatById"));
-    dispatch(actionPromiseClear("catAll"));
-    dispatch(actionPromiseClear("categoryUpsert"));
-};

+ 0 - 7
src/actions/actionAdminGoodPageClear.js

@@ -1,7 +0,0 @@
-import { actionPromiseClear } from "../reducers";
-
-export const actionAdminGoodPageClear = () => async (dispatch, getState) => {
-    dispatch(actionPromiseClear("adminGoodById"));
-    dispatch(actionPromiseClear("goodsAll"));
-    dispatch(actionPromiseClear("goodUpsert"));
-};

+ 0 - 8
src/actions/actionAdminOrderPageClear.js

@@ -1,8 +0,0 @@
-import { actionPromiseClear } from "../reducers";
-
-export const actionAdminOrderPageClear = () => async (dispatch, getState) => {
-    dispatch(actionPromiseClear("usersAll"));
-    dispatch(actionPromiseClear("goodsAll"));
-    dispatch(actionPromiseClear("adminOrderById"));
-    dispatch(actionPromiseClear("orderUpsert"));
-};

+ 0 - 16
src/actions/actionAdminUserPage.js

@@ -1,16 +0,0 @@
-import { actionPromiseClear } from "../reducers";
-import { actionCatAll } from "./actionCatAll";
-import { actionCatById } from "./actionCatById";
-import { actionGoodsAll } from "./actionGoodsAll";
-import { actionUserById } from "./actionUserById";
-
-export const actionAdminUserPage =
-    ({ _id }) =>
-    async (dispatch, getState) => {
-        dispatch(actionPromiseClear("uploadFile"));
-        if (_id) {
-            dispatch(actionUserById({ _id, promiseName: "adminUserById" }));
-        } else {
-            dispatch(actionPromiseClear("adminUserById"));
-        }
-    };

+ 0 - 6
src/actions/actionAdminUserPageClear.js

@@ -1,6 +0,0 @@
-import { actionPromiseClear } from "../reducers";
-
-export const actionAdminUserPageClear = () => async (dispatch, getState) => {
-    dispatch(actionPromiseClear("adminUserById"));
-    dispatch(actionPromiseClear("uploadFile"));
-};

+ 2 - 2
src/actions/actionAdminCategoriesPage.js

@@ -1,7 +1,7 @@
 import { actionFeedCats, actionFeedClear, actionPromiseClear } from "../reducers";
 
-export const actionAdminCategoriesPage =
-    ({ orderBy = "_id" }) =>
+export const actionCategoriesPage =
+    ({ orderBy = "_id" } = {}) =>
     async (dispatch, getState) => {
         dispatch(actionFeedClear());
         dispatch(actionPromiseClear("feedCatAll"));

+ 1 - 1
src/actions/actionAdminCategoriesPageClear.js

@@ -1,6 +1,6 @@
 import { actionFeedClear, actionPromiseClear } from "../reducers";
 
-export const actionAdminCategoriesPageClear = () => async (dispatch, getState) => {
+export const actionCategoriesPageClear = () => async (dispatch, getState) => {
     dispatch(actionFeedClear());
     dispatch(actionPromiseClear("feedCatAll"));
 };

+ 3 - 3
src/actions/actionAdminCategoriesSearchPage.js

@@ -1,7 +1,7 @@
-import { actionFeedCats, actionFeedCatsFind, actionFeedClear, actionPromiseClear } from "../reducers";
+import { actionFeedCatsFind, actionFeedClear, actionPromiseClear } from "../reducers";
 
-export const actionAdminCategoriesSearchPage =
-    ({ orderBy = "_id", text }) =>
+export const actionCategoriesSearchPage =
+    ({ orderBy = "_id", text = "" } = {}) =>
     async (dispatch, getState) => {
         dispatch(actionFeedClear());
         dispatch(actionPromiseClear("feedCatsFind"));

+ 1 - 2
src/actions/actionAdminCategoriesSearchPageClear.js

@@ -1,7 +1,6 @@
 import { actionFeedClear, actionPromiseClear } from "../reducers";
 
-export const actionAdminCategoriesSearchPageClear = () => async (dispatch, getState) => {
+export const actionCategoriesSearchPageClear = () => async (dispatch, getState) => {
     dispatch(actionFeedClear());
     dispatch(actionPromiseClear("feedCatsFind"));
-    // dispatch(actionPromiseClear("adminCatsFind"));
 };

+ 4 - 4
src/actions/actionAdminCategoryPage.js

@@ -3,15 +3,15 @@ import { actionCatAll } from "./actionCatAll";
 import { actionCatById } from "./actionCatById";
 import { actionGoodsAll } from "./actionGoodsAll";
 
-export const actionAdminCategoryPage =
-    ({ _id }) =>
+export const actionCategoryPage =
+    ({ _id, promiseName = "catById" } = {}) =>
     async (dispatch, getState) => {
         dispatch(actionGoodsAll());
         dispatch(actionCatAll());
 
         if (_id) {
-            dispatch(actionCatById({ _id, promiseName: "adminCatById" }));
+            dispatch(actionCatById({ _id, promiseName }));
         } else {
-            dispatch(actionPromiseClear("adminCatById"));
+            dispatch(actionPromiseClear(promiseName));
         }
     };

+ 9 - 0
src/actions/actionCategoryPageClear.js

@@ -0,0 +1,9 @@
+import { actionPromiseClear } from "../reducers";
+
+export const actionCategoryPageClear =
+    ({ promiseName = "catById" } = {}) =>
+    async (dispatch, getState) => {
+        dispatch(actionPromiseClear("goodsAll"));
+        dispatch(actionPromiseClear(promiseName));
+        dispatch(actionPromiseClear("catAll"));
+    };

+ 4 - 4
src/actions/actionAdminGoodPage.js

@@ -2,14 +2,14 @@ import { actionPromiseClear } from "../reducers";
 import { actionCatAll } from "./actionCatAll";
 import { actionGoodById } from "./actionGoodById";
 
-export const actionAdminGoodPage =
-    ({ _id }) =>
+export const actionGoodPage =
+    ({ _id, promiseName = "goodById" } = {}) =>
     async (dispatch, getState) => {
         dispatch(actionCatAll());
 
         if (_id) {
-            dispatch(actionGoodById({ _id, promiseName: "adminGoodById" }));
+            dispatch(actionGoodById({ _id, promiseName }));
         } else {
-            dispatch(actionPromiseClear("adminGoodById"));
+            dispatch(actionPromiseClear(promiseName));
         }
     };

+ 9 - 0
src/actions/actionGoodPageClear.js

@@ -0,0 +1,9 @@
+import { actionPromiseClear } from "../reducers";
+
+export const actionGoodPageClear =
+    ({ promiseName = "goodById" } = {}) =>
+    async (dispatch, getState) => {
+        dispatch(actionPromiseClear(promiseName));
+        dispatch(actionPromiseClear("goodsAll"));
+        dispatch(actionPromiseClear("goodUpsert"));
+    };

+ 1 - 2
src/actions/actionAdminGoodsPage.js

@@ -1,10 +1,9 @@
 import { actionFeedClear, actionFeedGoods, actionPromiseClear } from "../reducers";
 
-export const actionAdminGoodsPage =
+export const actionGoodsPage =
     ({ orderBy }) =>
     async (dispatch, getState) => {
         dispatch(actionFeedClear());
         dispatch(actionPromiseClear("feedGoodsAll"));
-        dispatch(actionPromiseClear("goodUpsert"));
         dispatch(actionFeedGoods({ skip: 0, orderBy }));
     };

+ 1 - 1
src/actions/actionAdminGoodsPageClear.js

@@ -1,6 +1,6 @@
 import { actionFeedClear, actionPromiseClear } from "../reducers";
 
-export const actionAdminGoodsPageClear = () => async (dispatch, getState) => {
+export const actionGoodsPageClear = () => async (dispatch, getState) => {
     dispatch(actionFeedClear());
     dispatch(actionPromiseClear("feedGoodsAll"));
     dispatch(actionPromiseClear("goodUpsert"));

+ 1 - 1
src/actions/actionAdminGoodsSearchPage.js

@@ -1,6 +1,6 @@
 import { actionFeedCats, actionFeedCatsFind, actionFeedClear, actionFeedGoodsFind, actionPromiseClear } from "../reducers";
 
-export const actionAdminGoodsSearchPage =
+export const actionGoodsSearchPage =
     ({ orderBy = "_id", text }) =>
     async (dispatch, getState) => {
         dispatch(actionFeedClear());

+ 1 - 1
src/actions/actionAdminGoodsSearchPageClear.js

@@ -1,6 +1,6 @@
 import { actionFeedClear, actionPromiseClear } from "../reducers";
 
-export const actionAdminGoodsSearchPageClear = () => async (dispatch, getState) => {
+export const actionGoodsSearchPageClear = () => async (dispatch, getState) => {
     dispatch(actionFeedClear());
     dispatch(actionPromiseClear("feedGoodsFind"));
 };

+ 4 - 4
src/actions/actionAdminOrderPage.js

@@ -3,15 +3,15 @@ import { actionGoodsAll } from "./actionGoodsAll";
 import { actionOrderById } from "./actionOrderById";
 import { actionUsersAll } from "./actionUsersAll";
 
-export const actionAdminOrderPage =
-    ({ _id }) =>
+export const actionOrderPage =
+    ({ _id, promiseName = "orderById" } = {}) =>
     async (dispatch, getState) => {
         dispatch(actionUsersAll());
         dispatch(actionGoodsAll());
 
         if (_id) {
-            dispatch(actionOrderById({ _id, promiseName: "adminOrderById" }));
+            dispatch(actionOrderById({ _id, promiseName }));
         } else {
-            dispatch(actionPromiseClear("adminOrderById"));
+            dispatch(actionPromiseClear(promiseName));
         }
     };

+ 10 - 0
src/actions/actionOrderPageClear.js

@@ -0,0 +1,10 @@
+import { actionPromiseClear } from "../reducers";
+
+export const actionOrderPageClear =
+    ({ promiseName = "orderById" } = {}) =>
+    async (dispatch, getState) => {
+        dispatch(actionPromiseClear("usersAll"));
+        dispatch(actionPromiseClear("goodsAll"));
+        dispatch(actionPromiseClear(promiseName));
+        dispatch(actionPromiseClear("orderUpsert"));
+    };

+ 2 - 3
src/actions/actionAdminOrdersPage.js

@@ -1,10 +1,9 @@
 import { actionFeedCats, actionFeedClear, actionFeedOrders, actionPromiseClear } from "../reducers";
 
-export const actionAdminOrdersPage =
-    ({ orderBy = "_id", status }) =>
+export const actionOrdersPage =
+    ({ orderBy = "_id", status = "0" } = {}) =>
     async (dispatch, getState) => {
         dispatch(actionFeedClear());
         dispatch(actionPromiseClear("feedOrdersAll"));
-        dispatch(actionPromiseClear("orderUpsert"));
         dispatch(actionFeedOrders({ skip: 0, orderBy, status }));
     };

+ 1 - 2
src/actions/actionAdminOrdersPageClear.js

@@ -1,7 +1,6 @@
 import { actionFeedClear, actionPromiseClear } from "../reducers";
 
-export const actionAdminOrdersPageClear = () => async (dispatch, getState) => {
+export const actionOrdersPageClear = () => async (dispatch, getState) => {
     dispatch(actionFeedClear());
     dispatch(actionPromiseClear("feedOrdersAll"));
-    dispatch(actionPromiseClear("orderUpsert"));
 };

+ 2 - 2
src/actions/actionAdminOrdersSearchPage.js

@@ -1,7 +1,7 @@
 import { actionFeedCats, actionFeedCatsFind, actionFeedClear, actionFeedOrdersFind, actionPromiseClear } from "../reducers";
 
-export const actionAdminOrdersSearchPage =
-    ({ orderBy = "_id", text, status }) =>
+export const actionOrdersSearchPage =
+    ({ orderBy = "_id", text, status } = {}) =>
     async (dispatch, getState) => {
         dispatch(actionFeedClear());
         dispatch(actionPromiseClear("feedOrdersFind"));

+ 1 - 1
src/actions/actionAdminOrdersSearchPageClear.js

@@ -1,6 +1,6 @@
 import { actionFeedClear, actionPromiseClear } from "../reducers";
 
-export const actionAdminOrdersSearchPageClear = () => async (dispatch, getState) => {
+export const actionOrdersSearchPageClear = () => async (dispatch, getState) => {
     dispatch(actionFeedClear());
     dispatch(actionPromiseClear("feedOrdersFind"));
 };

+ 13 - 0
src/actions/actionUserPage.js

@@ -0,0 +1,13 @@
+import { actionPromiseClear } from "../reducers";
+import { actionUserById } from "./actionUserById";
+
+export const actionUserPage =
+    ({ _id, promiseName = "userById" } = {}) =>
+    async (dispatch, getState) => {
+        dispatch(actionPromiseClear("uploadFile"));
+        if (_id) {
+            dispatch(actionUserById({ _id, promiseName }));
+        } else {
+            dispatch(actionPromiseClear(promiseName));
+        }
+    };

+ 8 - 0
src/actions/actionUserPageClear.js

@@ -0,0 +1,8 @@
+import { actionPromiseClear } from "../reducers";
+
+export const actionUserPageClear =
+    ({ promiseName = "userById" } = {}) =>
+    async (dispatch, getState) => {
+        dispatch(actionPromiseClear(promiseName));
+        dispatch(actionPromiseClear("uploadFile"));
+    };

+ 3 - 3
src/actions/actionAdminUsersPage.js

@@ -1,7 +1,7 @@
-import { actionFeedCats, actionFeedClear, actionFeedUsers, actionPromiseClear } from "../reducers";
+import { actionFeedClear, actionFeedUsers, actionPromiseClear } from "../reducers";
 
-export const actionAdminUsersPage =
-    ({ orderBy = "_id" }) =>
+export const actionUsersPage =
+    ({ orderBy = "_id" } = {}) =>
     async (dispatch, getState) => {
         dispatch(actionFeedClear());
         dispatch(actionPromiseClear("feedUsersAll"));

+ 1 - 2
src/actions/actionAdminUsersPageClear.js

@@ -1,7 +1,6 @@
 import { actionFeedClear, actionPromiseClear } from "../reducers";
 
-export const actionAdminUsersPageClear = () => async (dispatch, getState) => {
+export const actionUsersPageClear = () => async (dispatch, getState) => {
     dispatch(actionFeedClear());
     dispatch(actionPromiseClear("feedUsersAll"));
-    dispatch(actionPromiseClear("userUpsert"));
 };

+ 2 - 2
src/actions/actionAdminUsersSearchPage.js

@@ -1,7 +1,7 @@
 import { actionFeedClear, actionFeedUsersFind, actionPromiseClear } from "../reducers";
 
-export const actionAdminUsersSearchPage =
-    ({ orderBy = "_id", text }) =>
+export const actionUsersSearchPage =
+    ({ orderBy = "_id", text = "" } = {}) =>
     async (dispatch, getState) => {
         dispatch(actionFeedClear());
         dispatch(actionPromiseClear("feedUsersFind"));

+ 1 - 1
src/actions/actionAdminUsersSearchPageClear.js

@@ -1,6 +1,6 @@
 import { actionFeedClear, actionPromiseClear } from "../reducers";
 
-export const actionAdminUsersSearchPageClear = () => async (dispatch, getState) => {
+export const actionUsersSearchPageClear = () => async (dispatch, getState) => {
     dispatch(actionFeedClear());
     dispatch(actionPromiseClear("feedUsersFind"));
 };

+ 4 - 4
src/components/admin/AdminLayoutPage/AdminCategoryLayout/AdminCategoriesPageContainer.js

@@ -2,8 +2,8 @@ import { connect } from "react-redux";
 import { useEffect } from "react";
 import { useDispatch } from "react-redux";
 import { useSearchParams } from "react-router-dom";
-import { actionAdminCategoriesPage } from "../../../../actions/actionAdminCategoriesPage";
-import { actionAdminCategoriesPageClear } from "../../../../actions/actionAdminCategoriesPageClear";
+import { actionCategoriesPage } from "../../../../actions/actionCategoriesPage";
+import { actionCategoriesPageClear } from "../../../../actions/actionCategoriesPageClear";
 import { actionFeedAdd, actionFeedCats } from "../../../../reducers";
 import { AdminCategoriesPage } from "../../AdminCategoriesPage";
 
@@ -46,8 +46,8 @@ export const CAdminCategoriesPageContainer = connect(
         promiseStatus: state.promise?.feedCatAll?.status || null,
     }),
     {
-        onUnmount: () => actionAdminCategoriesPageClear(),
-        onLoad: ({ orderBy }) => actionAdminCategoriesPage({ orderBy }),
+        onUnmount: () => actionCategoriesPageClear(),
+        onLoad: ({ orderBy }) => actionCategoriesPage({ orderBy }),
         onScroll: ({ feed, orderBy }) => actionFeedCats({ skip: feed?.length || 0, orderBy }),
     }
 )(AdminCategoriesPageContainer);

+ 4 - 4
src/components/admin/AdminLayoutPage/AdminCategoryLayout/AdminCategoriesSearchPageContainer.js

@@ -2,8 +2,8 @@ import { connect } from "react-redux";
 import { useEffect } from "react";
 import { useDispatch } from "react-redux";
 import { useSearchParams } from "react-router-dom";
-import { actionAdminCategoriesSearchPage } from "../../../../actions/actionAdminCategoriesSearchPage";
-import { actionAdminCategoriesSearchPageClear } from "../../../../actions/actionAdminCategoriesSearchPageClear";
+import { actionCategoriesSearchPage } from "../../../../actions/actionCategoriesSearchPage";
+import { actionCategoriesSearchPageClear } from "../../../../actions/actionCategoriesSearchPageClear";
 import { actionFeedAdd, actionFeedCatsFind } from "../../../../reducers";
 import { AdminCategoriesPage } from "../../AdminCategoriesPage";
 
@@ -47,8 +47,8 @@ export const CAdminCategoriesSearchPageContainer = connect(
         promiseStatus: state.promise?.feedCatsFind?.status || null,
     }),
     {
-        onUnmount: () => actionAdminCategoriesSearchPageClear(),
-        onLoad: ({ orderBy, text }) => actionAdminCategoriesSearchPage({ orderBy, text }),
+        onUnmount: () => actionCategoriesSearchPageClear(),
+        onLoad: ({ orderBy, text }) => actionCategoriesSearchPage({ orderBy, text }),
         onScroll: ({ feed, orderBy, text }) => actionFeedCatsFind({ text, skip: feed?.length || 0, orderBy }),
     }
 )(AdminCategoriesSearchPageContainer);

+ 4 - 4
src/components/admin/AdminLayoutPage/AdminCategoryLayout/AdminCategoryPageContainer.js

@@ -1,8 +1,8 @@
 import { connect } from "react-redux";
 import { useEffect } from "react";
 import { useParams } from "react-router-dom";
-import { actionAdminCategoryPage } from "../../../../actions/actionAdminCategoryPage";
-import { actionAdminCategoryPageClear } from "../../../../actions/actionAdminCategoryPageClear";
+import { actionCategoryPage } from "../../../../actions/actionCategoryPage";
+import { actionCategoryPageClear } from "../../../../actions/actionCategoryPageClear";
 import { CAdminCategoryPage } from "../../AdminCategoryPage";
 
 const AdminCategoryPageContainer = ({ onUnmount, onLoad }) => {
@@ -19,6 +19,6 @@ const AdminCategoryPageContainer = ({ onUnmount, onLoad }) => {
 };
 
 export const CAdminCategoryPageContainer = connect(null, {
-    onUnmount: () => actionAdminCategoryPageClear(),
-    onLoad: (_id) => actionAdminCategoryPage({ _id }),
+    onUnmount: () => actionCategoryPageClear({ promiseName: "adminCatById" }),
+    onLoad: (_id) => actionCategoryPage({ _id, promiseName: "adminCatById" }),
 })(AdminCategoryPageContainer);

+ 4 - 4
src/components/admin/AdminLayoutPage/AdminGoodLayout/AdminGoodPageContainer.js

@@ -1,6 +1,6 @@
 import { CAdminGoodPage } from "../../AdminGoodPage";
-import { actionAdminGoodPage } from "../../../../actions/actionAdminGoodPage";
-import { actionAdminGoodPageClear } from "../../../../actions/actionAdminGoodPageClear";
+import { actionGoodPage } from "../../../../actions/actionGoodPage";
+import { actionGoodPageClear } from "../../../../actions/actionGoodPageClear";
 import { useParams } from "react-router-dom";
 import { useEffect } from "react";
 import { connect } from "react-redux";
@@ -19,6 +19,6 @@ const AdminGoodPageContainer = ({ onUnmount, onLoad }) => {
 };
 
 export const CAdminGoodPageContainer = connect(null, {
-    onUnmount: () => actionAdminGoodPageClear(),
-    onLoad: (_id) => actionAdminGoodPage({ _id }),
+    onUnmount: () => actionGoodPageClear({ promiseName: "adminGoodById" }),
+    onLoad: (_id) => actionGoodPage({ _id, promiseName: "adminGoodById" }),
 })(AdminGoodPageContainer);

+ 4 - 4
src/components/admin/AdminLayoutPage/AdminGoodLayout/AdminGoodsPageContainer.js

@@ -1,5 +1,5 @@
-import { actionAdminGoodsPageClear } from "../../../../actions/actionAdminGoodsPageClear";
-import { actionAdminGoodsPage } from "../../../../actions/actionAdminGoodsPage";
+import { actionGoodsPageClear } from "../../../../actions/actionGoodsPageClear";
+import { actionGoodsPage } from "../../../../actions/actionGoodsPage";
 import { useSearchParams } from "react-router-dom";
 import { useEffect } from "react";
 import { InfScroll } from "../../../common/InfScroll";
@@ -36,8 +36,8 @@ export const CAdminGoodsPageContainer = connect(
         promiseStatus: state.promise?.feedGoodsAll?.status || null,
     }),
     {
-        onUnmount: () => actionAdminGoodsPageClear(),
-        onLoad: ({ orderBy }) => actionAdminGoodsPage({ orderBy }),
+        onUnmount: () => actionGoodsPageClear(),
+        onLoad: ({ orderBy }) => actionGoodsPage({ orderBy }),
         onScroll: ({ feed, orderBy }) => actionFeedGoods({ skip: feed?.length || 0, orderBy }),
     }
 )(AdminGoodsPageContainer);

+ 4 - 4
src/components/admin/AdminLayoutPage/AdminGoodLayout/AdminGoodsSearchPageContainer.js

@@ -1,8 +1,8 @@
 import { connect } from "react-redux";
 import { useEffect } from "react";
 import { useSearchParams } from "react-router-dom";
-import { actionAdminGoodsSearchPage } from "../../../../actions/actionAdminGoodsSearchPage";
-import { actionAdminGoodsSearchPageClear } from "../../../../actions/actionAdminGoodsSearchPageClear";
+import { actionGoodsSearchPage } from "../../../../actions/actionGoodsSearchPage";
+import { actionGoodsSearchPageClear } from "../../../../actions/actionGoodsSearchPageClear";
 import { actionFeedGoodsFind } from "../../../../reducers";
 import { InfScroll } from "../../../common/InfScroll";
 import { AdminGoodsPage } from "../../AdminGoodsPage";
@@ -37,8 +37,8 @@ export const CAdminGoodsSearchPageContainer = connect(
         promiseStatus: state.promise?.feedGoodsFind?.status || null,
     }),
     {
-        onUnmount: () => actionAdminGoodsSearchPageClear(),
-        onLoad: ({ orderBy, text }) => actionAdminGoodsSearchPage({ orderBy, text }),
+        onUnmount: () => actionGoodsSearchPageClear(),
+        onLoad: ({ orderBy, text }) => actionGoodsSearchPage({ orderBy, text }),
         onScroll: ({ feed, orderBy, text }) => actionFeedGoodsFind({ text, skip: feed?.length || 0, orderBy }),
     }
 )(AdminGoodsSearchPageContainer);

+ 4 - 4
src/components/admin/AdminLayoutPage/AdminOrderLayout/AdminOrderPageContainer.js

@@ -1,8 +1,8 @@
 import { connect } from "react-redux";
 import { useEffect } from "react";
 import { useParams } from "react-router-dom";
-import { actionAdminOrderPage } from "../../../../actions/actionAdminOrderPage";
-import { actionAdminOrderPageClear } from "../../../../actions/actionAdminOrderPageClear";
+import { actionOrderPage } from "../../../../actions/actionOrderPage";
+import { actionOrderPageClear } from "../../../../actions/actionOrderPageClear";
 import { CAdminOrderPage } from "../../AdminOrderPage";
 
 const AdminOrderPageContainer = ({ onLoad, onUnmount }) => {
@@ -19,6 +19,6 @@ const AdminOrderPageContainer = ({ onLoad, onUnmount }) => {
 };
 
 export const CAdminOrderPageContainer = connect(null, {
-    onUnmount: () => actionAdminOrderPageClear(),
-    onLoad: (_id) => actionAdminOrderPage({ _id }),
+    onUnmount: () => actionOrderPageClear({ promiseName: "adminOrderById" }),
+    onLoad: (_id) => actionOrderPage({ _id, promiseName: "adminOrderById" }),
 })(AdminOrderPageContainer);

+ 4 - 4
src/components/admin/AdminLayoutPage/AdminOrderLayout/AdminOrdersPageContainer.js

@@ -1,8 +1,8 @@
 import { connect } from "react-redux";
 import { useEffect } from "react";
 import { useSearchParams } from "react-router-dom";
-import { actionAdminOrdersPage } from "../../../../actions/actionAdminOrdersPage";
-import { actionAdminOrdersPageClear } from "../../../../actions/actionAdminOrdersPageClear";
+import { actionOrdersPage } from "../../../../actions/actionOrdersPage";
+import { actionOrdersPageClear } from "../../../../actions/actionOrdersPageClear";
 import { actionFeedOrders } from "../../../../reducers";
 import { InfScroll } from "../../../common/InfScroll";
 import { AdminOrdersPage } from "../../AdminOrdersPage";
@@ -37,8 +37,8 @@ export const CAdminOrdersPageContainer = connect(
         promiseStatus: state.promise?.feedOrdersAll?.status || null,
     }),
     {
-        onUnmount: () => actionAdminOrdersPageClear(),
-        onLoad: ({ orderBy, status }) => actionAdminOrdersPage({ orderBy, status }),
+        onUnmount: () => actionOrdersPageClear(),
+        onLoad: ({ orderBy, status }) => actionOrdersPage({ orderBy, status }),
         onScroll: ({ feed, orderBy, status }) => actionFeedOrders({ skip: feed?.length || 0, orderBy, status }),
     }
 )(AdminOrdersPageContainer);

+ 3 - 3
src/components/admin/AdminLayoutPage/AdminOrderLayout/AdminOrdersSearchPageContainer.js

@@ -1,7 +1,7 @@
 import { connect } from "react-redux";
 import { useEffect } from "react";
 import { useSearchParams } from "react-router-dom";
-import { actionAdminOrdersSearchPageClear } from "../../../../actions/actionAdminOrdersSearchPageClear";
+import { actionOrdersSearchPageClear } from "../../../../actions/actionOrdersSearchPageClear";
 import { actionFeedOrdersFind } from "../../../../reducers";
 import { InfScroll } from "../../../common/InfScroll";
 import { AdminOrdersPage } from "../../AdminOrdersPage";
@@ -37,8 +37,8 @@ export const CAdminOrdersSearchPageContainer = connect(
         promiseStatus: state.promise?.feedOrdersFind?.status || null,
     }),
     {
-        onUnmount: () => actionAdminOrdersSearchPageClear(),
-        onLoad: ({ orderBy, text, status }) => actionAdminOrdersSearchPageClear({ orderBy, text, status }),
+        onUnmount: () => actionOrdersSearchPageClear(),
+        onLoad: ({ orderBy, text, status }) => actionOrdersSearchPageClear({ orderBy, text, status }),
         onScroll: ({ feed, orderBy, text, status }) => actionFeedOrdersFind({ text, skip: feed?.length || 0, orderBy, status }),
     }
 )(AdminOrdersSearchPageContainer);

+ 4 - 4
src/components/admin/AdminLayoutPage/AdminUserLayout/AdminUserPageContainer.js

@@ -1,8 +1,8 @@
 import { connect } from "react-redux";
 import { useEffect } from "react";
 import { useParams } from "react-router-dom";
-import { actionAdminUserPage } from "../../../../actions/actionAdminUserPage";
-import { actionAdminUserPageClear } from "../../../../actions/actionAdminUserPageClear";
+import { actionUserPage } from "../../../../actions/actionUserPage";
+import { actionUserPageClear } from "../../../../actions/actionUserPageClear";
 import { CAdminUserPage } from "../../AdminUserPage.js";
 
 const AdminUserPageContainer = ({ onLoad, onUnmount }) => {
@@ -21,6 +21,6 @@ const AdminUserPageContainer = ({ onLoad, onUnmount }) => {
 };
 
 export const CAdminUserPageContainer = connect(null, {
-    onUnmount: () => actionAdminUserPageClear(),
-    onLoad: (_id) => actionAdminUserPage({ _id }),
+    onUnmount: () => actionUserPageClear({ promiseName: "adminUserById" }),
+    onLoad: (_id) => actionUserPage({ _id, promiseName: "adminUserById" }),
 })(AdminUserPageContainer);

+ 4 - 4
src/components/admin/AdminLayoutPage/AdminUserLayout/AdminUsersPageContainer.js

@@ -1,8 +1,8 @@
 import { connect } from "react-redux";
 import { useEffect } from "react";
 import { useSearchParams } from "react-router-dom";
-import { actionAdminUsersPage } from "../../../../actions/actionAdminUsersPage";
-import { actionAdminUsersPageClear } from "../../../../actions/actionAdminUsersPageClear";
+import { actionUsersPage } from "../../../../actions/actionUsersPage";
+import { actionUsersPageClear } from "../../../../actions/actionUsersPageClear";
 import { actionFeedUsers } from "../../../../reducers";
 import { InfScroll } from "../../../common/InfScroll";
 import { AdminUsersPage } from "../../AdminUsersPage";
@@ -36,8 +36,8 @@ export const CAdminUsersPageContainer = connect(
         promiseStatus: state.promise?.feedUsersAll?.status || null,
     }),
     {
-        onUnmount: () => actionAdminUsersPageClear(),
-        onLoad: ({ orderBy }) => actionAdminUsersPage({ orderBy }),
+        onUnmount: () => actionUsersPageClear(),
+        onLoad: ({ orderBy }) => actionUsersPage({ orderBy }),
         onScroll: ({ feed, orderBy }) => actionFeedUsers({ skip: feed?.length || 0, orderBy }),
     }
 )(AdminUsersPageContainer);

+ 4 - 4
src/components/admin/AdminLayoutPage/AdminUserLayout/AdminUsersSearchPageContainer.js

@@ -1,8 +1,8 @@
 import { connect } from "react-redux";
 import { useEffect } from "react";
 import { useSearchParams } from "react-router-dom";
-import { actionAdminUsersSearchPage } from "../../../../actions/actionAdminUsersSearchPage";
-import { actionAdminUsersSearchPageClear } from "../../../../actions/actionAdminUsersSearchPageClear";
+import { actionUsersSearchPage } from "../../../../actions/actionUsersSearchPage";
+import { actionUsersSearchPageClear } from "../../../../actions/actionUsersSearchPageClear";
 import { actionFeedUsersFind } from "../../../../reducers";
 import { InfScroll } from "../../../common/InfScroll";
 import { AdminUsersPage } from "../../AdminUsersPage";
@@ -37,8 +37,8 @@ export const CAdminUsersSearchPageContainer = connect(
         promiseStatus: state.promise?.feedUsersFind?.status || null,
     }),
     {
-        onUnmount: () => actionAdminUsersSearchPageClear(),
-        onLoad: ({ orderBy, text }) => actionAdminUsersSearchPage({ orderBy, text }),
+        onUnmount: () => actionUsersSearchPageClear(),
+        onLoad: ({ orderBy, text }) => actionUsersSearchPage({ orderBy, text }),
         onScroll: ({ feed, orderBy, text }) => actionFeedUsersFind({ text, skip: feed?.length || 0, orderBy }),
     }
 )(AdminUsersSearchPageContainer);