Browse Source

+ adminGoodPage | + adminCategoryPage

ilya_shyian 2 years ago
parent
commit
2fd3c8fb9a

+ 1 - 1
src/actions/actionAboutMe.js

@@ -1,6 +1,6 @@
 import { gql } from "../helpers";
 import { actionPromise } from "../reducers";
-import { promiseWatcher, promiseWorker } from "../reducers/promiseReducer";
+import { promiseWorker } from "../reducers/promiseReducer";
 import { call, select } from "redux-saga/effects";
 
 export const actionAboutMe = () => ({ type: "ABOUT_ME" });

+ 14 - 8
src/actions/actionCategoriesPage.js

@@ -1,10 +1,16 @@
+import { put, take } from "redux-saga/effects";
 import { actionFeedCats, actionFeedClear, actionPromiseClear } from "../reducers";
 
-export const actionCategoriesPage =
-    ({ orderBy = "_id" } = {}) =>
-    async (dispatch, getState) => {
-        dispatch(actionFeedClear());
-        dispatch(actionPromiseClear("feedCatAll"));
-        dispatch(actionPromiseClear("categoryUpsert"));
-        dispatch(actionFeedCats({ skip: 0, orderBy }));
-    };
+export const actionCategoriesPage = ({ orderBy }) => ({ type: "CATEGORIES_PAGE", payload: { orderBy } });
+
+export function* categoriesPageWorker(action) {
+    const { orderBy = "_id" } = action.payload || {};
+    yield put(actionFeedClear());
+    yield put(actionPromiseClear("feedCatAll"));
+    yield put(actionPromiseClear("categoryUpsert"));
+    yield put(actionFeedCats({ skip: 0, orderBy }));
+
+    yield take("CATEGORIES_PAGE_CLEAR");
+    yield put(actionFeedClear());
+    yield put(actionPromiseClear("feedCatAll"));
+}

+ 0 - 6
src/actions/actionCategoriesPageClear.js

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

+ 4 - 0
src/actions/actionCategoriesSearchPageClear.js

@@ -4,3 +4,7 @@ export const actionCategoriesSearchPageClear = () => async (dispatch, getState)
     dispatch(actionFeedClear());
     dispatch(actionPromiseClear("feedCatsFind"));
 };
+
+const actions = {
+    actionCategoriesSearchPageClear: "actionCategoriesSearchPageClear",
+};

+ 22 - 11
src/actions/actionGoodPage.js

@@ -1,15 +1,26 @@
+import { put, take } from "redux-saga/effects";
 import { actionPromiseClear } from "../reducers";
 import { actionCatAll } from "./actionCatAll";
 import { actionGoodById } from "./actionGoodById";
 
-export const actionGoodPage =
-    ({ _id, promiseName = "goodById" } = {}) =>
-    async (dispatch, getState) => {
-        dispatch(actionCatAll());
-
-        if (_id) {
-            dispatch(actionGoodById({ _id, promiseName }));
-        } else {
-            dispatch(actionPromiseClear(promiseName));
-        }
-    };
+export const actionGoodPage = ({ _id, promiseName } = {}) => ({
+    type: "GOOD_PAGE",
+    payload: { _id, promiseName },
+});
+
+export function* goodPageWorker(action) {
+    const { _id, promiseName = "goodById" } = action.payload;
+    yield put(actionCatAll());
+
+    if (_id) {
+        yield put(actionGoodById({ _id, promiseName }));
+    } else {
+        yield put(actionPromiseClear(promiseName));
+    }
+
+    yield take("GOOD_PAGE_CLEAR");
+
+    yield put(actionPromiseClear(promiseName));
+    yield put(actionPromiseClear("goodsAll"));
+    yield put(actionPromiseClear("goodUpsert"));
+}

+ 0 - 9
src/actions/actionGoodPageClear.js

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

+ 16 - 21
src/actions/actionGoodsAll.js

@@ -1,14 +1,11 @@
 import { gql } from "../helpers";
 import { actionPromise } from "../reducers";
 
-export const actionGoodsAll =
-    ({ limit = 20, skip = 0, promiseName = "goodsAll", orderBy = "_id" } = {}) =>
-    async (dispatch, getState) => {
-        dispatch(
-            actionPromise(
-                promiseName,
-                gql(
-                    `query GoodsAll($query:String){
+export const actionGoodsAll = ({ limit = 20, skip = 0, promiseName = "goodsAll", orderBy = "_id" } = {}) =>
+    actionPromise(
+        promiseName,
+        gql(
+            `query GoodsAll($query:String){
                         GoodFind(query: $query){
                             _id name price images{
                                 _id url
@@ -19,17 +16,15 @@ export const actionGoodsAll =
                             amount
                         }
                     }`,
+            {
+                query: JSON.stringify([
+                    {},
                     {
-                        query: JSON.stringify([
-                            {},
-                            {
-                                limit: !!limit ? limit : 100,
-                                skip: skip,
-                                orderBy,
-                            },
-                        ]),
-                    }
-                )
-            )
-        );
-    };
+                        limit: !!limit ? limit : 100,
+                        skip: skip,
+                        orderBy,
+                    },
+                ]),
+            }
+        )
+    );

+ 31 - 25
src/actions/actionGoodsFind.js

@@ -1,14 +1,20 @@
+import { call, delay, put } from "redux-saga/effects";
 import { gql } from "../helpers";
 import { actionPromise } from "../reducers";
-
-export const actionGoodsFind =
-    ({ text = "", limit = 7, skip = 0, promiseName = "goodsFind", orderBy = "_id" }) =>
-    async (dispatch, getState) => {
-        dispatch(
-            actionPromise(
-                promiseName,
-                gql(
-                    `query GoodsFind($query:String){
+import { promiseWorker } from "../reducers/promiseReducer";
+export const actionGoodsFind = ({ text, limit, skip, promiseName, orderBy, delay }) => ({
+    type: "GOODS_FIND",
+    payload: { text, limit, skip, promiseName, orderBy, delay },
+});
+export function* goodsFindWorker(action) {
+    const { text = "", limit = 7, skip = 0, promiseName = "goodsFind", orderBy = "_id", timeout = 0 } = action.payload || {};
+    yield delay(timeout);
+    yield call(
+        promiseWorker,
+        actionPromise(
+            promiseName,
+            gql(
+                `query GoodsFind($query:String){
                         GoodFind(query: $query){
                             _id name price images{
                                 _id url
@@ -19,20 +25,20 @@ export const actionGoodsFind =
                             amount
                         }
                     }`,
-                    {
-                        query: JSON.stringify([
-                            {
-                                name__contains: text,
-                                description__contains: text,
-                            },
-                            {
-                                limit: !!limit ? limit : 5,
-                                skip,
-                                orderBy,
-                            },
-                        ]),
-                    }
-                )
+                {
+                    query: JSON.stringify([
+                        {
+                            name__contains: text,
+                            description__contains: text,
+                        },
+                        {
+                            limit: !!limit ? limit : 5,
+                            skip,
+                            orderBy,
+                        },
+                    ]),
+                }
             )
-        );
-    };
+        )
+    );
+}

+ 14 - 7
src/actions/actionGoodsPage.js

@@ -1,9 +1,16 @@
+import { put, take } from "redux-saga/effects";
 import { actionFeedClear, actionFeedGoods, actionPromiseClear } from "../reducers";
 
-export const actionGoodsPage =
-    ({ orderBy }) =>
-    async (dispatch, getState) => {
-        dispatch(actionFeedClear());
-        dispatch(actionPromiseClear("feedGoodsAll"));
-        dispatch(actionFeedGoods({ skip: 0, orderBy }));
-    };
+export const actionGoodsPage = ({ orderBy }) => ({ type: "GOODS_PAGE", payload: { orderBy } });
+export function* goodsPageWorker(action) {
+    const { orderBy = "_id" } = action.payload || {};
+    yield put(actionFeedClear());
+    yield put(actionPromiseClear("feedGoodsAll"));
+    yield put(actionFeedGoods({ skip: 0, orderBy }));
+
+    yield take("GOODS_PAGE_CLEAR");
+
+    yield put(actionFeedClear());
+    yield put(actionPromiseClear("feedGoodsAll"));
+    yield put(actionPromiseClear("goodUpsert"));
+}

+ 0 - 7
src/actions/actionGoodsPageClear.js

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

+ 14 - 8
src/actions/actionGoodsSearchPage.js

@@ -1,9 +1,15 @@
-import { actionFeedCats, actionFeedCatsFind, actionFeedClear, actionFeedGoodsFind, actionPromiseClear } from "../reducers";
+import { put, take } from "redux-saga/effects";
+import { actionFeedClear, actionFeedGoodsFind, actionPromiseClear } from "../reducers";
 
-export const actionGoodsSearchPage =
-    ({ orderBy = "_id", text }) =>
-    async (dispatch, getState) => {
-        dispatch(actionFeedClear());
-        dispatch(actionPromiseClear("feedGoodsFind"));
-        dispatch(actionFeedGoodsFind({ text, orderBy, skip: 0 }));
-    };
+export const actionGoodsSearchPage = ({ orderBy = "_id", text } = {}) => ({ type: "GOODS_SEARCH_PAGE", payload: { orderBy, text } });
+
+export function* goodsSearchPageWorker(action) {
+    const { orderBy = "_id", text } = action.payload || {};
+    yield put(actionFeedClear());
+    yield put(actionPromiseClear("feedGoodsFind"));
+    yield put(actionFeedGoodsFind({ text, orderBy, skip: 0 }));
+    yield take("GOODS_SEARCH_PAGE_CLEAR");
+
+    yield put(actionFeedClear());
+    yield put(actionPromiseClear("feedGoodsFind"));
+}

+ 0 - 49
src/actions/actionRootCats.js

@@ -20,52 +20,3 @@ export const actionRootCats = () =>
             }
         )
     );
-
-// () => ({
-//     data: [
-//         {
-//             id: 1,
-//             name: 'Categoty 1',
-//         },
-//         {
-//             id: 2,
-//             name: 'Categoty 2',
-//         },
-//         {
-//             id: 3,
-//             name: 'Categoty 3',
-//         },
-//         {
-//             id: 4,
-//             name: 'Categoty 4',
-//         },
-//     ],
-// }),
-
-// .then((data) => {
-//     if (data.errors) {
-//         throw new Error(JSON.stringify(data.errors));
-//     } else return Object.values(data.data)[0];
-// })
-// fetch(backendURL + "/api/reception/patient/", {
-//     method: "GET",
-//     headers: {
-//         "Content-Type": "application/json",
-//         ...(localStorage.authToken ? { Authorization: "Bearer " + localStorage.authToken } : {}),
-//     },
-// });
-
-// actionPromise("patientAll",    fetch(url, {
-//     type:"GET",
-//     headers: {
-//         "Content-Type": "application/json",
-//         ...(localStorage.authToken ? { Authorization: "Bearer " + localStorage.authToken } : {}),
-//     },
-//     body: data,
-// })
-//     .then((res) => res.json())
-//     .then((data) => {
-//         if (typeof data === "string") {
-//             throw new Error(data);
-//         } else return Object.values(data);
-//     }))

+ 1 - 1
src/components/GoodPage/index.js

@@ -14,7 +14,7 @@ export const GoodPage = () => {
             <Grid container spacing={4} className="images">
                 <Grid item xs={12} md={4}>
                     <Carousel showIndicators={false} showStatus={false} showArrows={true}>
-                        {(good.images || [{ _id: 0, url: defaultGoodImage }]).map((image) => (
+                        {(!!good?.images?.length ? good?.images : [{ _id: 0, url: defaultGoodImage }]).map((image) => (
                             <img
                                 key={image?._id}
                                 src={image?.url ? `${backendURL}${mediaURL}${image?.url}` : defaultGoodImage}

+ 1 - 1
src/components/LayoutPage/GoodsSearchPageContainer.js

@@ -37,7 +37,7 @@ export const CAdminGoodsSearchPageContainer = connect(
         promiseStatus: state.promise?.feedGoodsFind?.status || null,
     }),
     {
-        onUnmount: () => actionGoodsSearchPageClear(),
+        onUnmount: () => ({ type: "GOOD_SEARCH_PAGE_CLEAR" }),
         onLoad: ({ orderBy, text }) => actionGoodsSearchPage({ orderBy, text }),
         onScroll: ({ feed, orderBy, text }) => actionFeedGoodsFind({ text, skip: feed?.length || 0, orderBy }),
     }

+ 5 - 2
src/components/LayoutPage/index.js

@@ -19,10 +19,13 @@ import { MainPage } from "../MainPage";
 import { CAdminGoodsPageContainer } from "./GoodsPageContainer";
 import { CAdminGoodsSearchPageContainer } from "./GoodsSearchPageContainer";
 
-const GoodPageContainer = ({ onLoad }) => {
+const GoodPageContainer = ({ onLoad, onUnmount }) => {
     const params = useParams();
     useEffect(() => {
         onLoad({ _id: params._id });
+        return () => {
+            onUnmount && onUnmount();
+        };
     }, []);
 
     return <GoodPage />;
@@ -44,7 +47,7 @@ const CDashboardPageContainer = connect(null, {
     onLoad: () => actionOrders(),
 })(DashboardPageContainer);
 
-const CGoodsList = connect((state) => ({ goods: state.promise?.pageGoodsFind?.payload || [] }))(GoodList);
+// const CGoodsList = connect((state) => ({ goods: state.promise?.pageGoodsFind?.payload || [] }))(GoodList);
 
 // const GoodsListContainer = ({ onLoad }) => {
 //     const params = useParams();

+ 1 - 2
src/components/admin/AdminLayoutPage/AdminCategoryLayout/AdminCategoriesPageContainer.js

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

+ 1 - 2
src/components/admin/AdminLayoutPage/AdminGoodLayout/AdminGoodPageContainer.js

@@ -1,6 +1,5 @@
 import { CAdminGoodPage } from "../../AdminGoodPage";
 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 +18,6 @@ const AdminGoodPageContainer = ({ onUnmount, onLoad }) => {
 };
 
 export const CAdminGoodPageContainer = connect(null, {
-    onUnmount: () => actionGoodPageClear({ promiseName: "adminGoodById" }),
+    onUnmount: () => ({ type: "GOOD_PAGE_CLEAR" }),
     onLoad: (_id) => actionGoodPage({ _id, promiseName: "adminGoodById" }),
 })(AdminGoodPageContainer);

+ 1 - 2
src/components/admin/AdminLayoutPage/AdminGoodLayout/AdminGoodsPageContainer.js

@@ -1,4 +1,3 @@
-import { actionGoodsPageClear } from "../../../../actions/actionGoodsPageClear";
 import { actionGoodsPage } from "../../../../actions/actionGoodsPage";
 import { useSearchParams } from "react-router-dom";
 import { useEffect } from "react";
@@ -36,7 +35,7 @@ export const CAdminGoodsPageContainer = connect(
         promiseStatus: state.promise?.feedGoodsAll?.status || null,
     }),
     {
-        onUnmount: () => actionGoodsPageClear(),
+        onUnmount: () => ({ type: "GOODS_PAGE_CLEAR" }),
         onLoad: ({ orderBy }) => actionGoodsPage({ orderBy }),
         onScroll: ({ feed, orderBy }) => actionFeedGoods({ skip: feed?.length || 0, orderBy }),
     }

+ 3 - 15
src/components/common/SearchBar/SearchBar.js

@@ -20,7 +20,6 @@ export const SearchBar = ({
     const [searchParams] = useSearchParams();
     const [inputValue, setInputValue] = useState("");
     const [isChildrenOpen, setIsChildrenOpen] = useState(false);
-    const [inputTimeout, setInputTimeout] = useState(null);
     const [touched, setTouched] = useState(false);
     const R = render;
 
@@ -46,10 +45,6 @@ export const SearchBar = ({
     }, [searchParams]);
 
     useEffect(() => {
-        if (inputTimeout) {
-            clearTimeout(inputTimeout);
-        }
-
         const checkClickOutsideHeaderSearchBar = (e) => {
             if (ref.current && !ref.current.contains(e.target)) {
                 setIsChildrenOpen(false);
@@ -57,15 +52,8 @@ export const SearchBar = ({
                 inputValue.length && setIsChildrenOpen(true);
             }
         };
-        if (inputTimeout) {
-            clearTimeout(inputTimeout);
-            setInputTimeout(null);
-        }
-        setInputTimeout(
-            setTimeout(() => {
-                inputValue && onSearch(inputValue);
-            }, 700)
-        );
+
+        inputValue && onSearch(inputValue);
 
         touched && setIsChildrenOpen(!!inputValue?.length);
         document.addEventListener("mousedown", checkClickOutsideHeaderSearchBar);
@@ -121,6 +109,6 @@ export const SearchBar = ({
 };
 
 export const CSearchBar = connect(null, {
-    onSearch: (text) => actionGoodsFind({ text, limit: 5 }),
+    onSearch: (text) => actionGoodsFind({ text, limit: 5, delay: 1500 }),
     onSearchEnd: () => actionPromiseClear("goodsFind"),
 })(SearchBar);

+ 1 - 2
src/components/layout/Header/index.js

@@ -1,6 +1,6 @@
 import { AppBar, Box, Button, IconButton, Stack, Toolbar, Typography } from "@mui/material";
 import { useState } from "react";
-import { useDispatch, useSelector } from "react-redux";
+import { useSelector } from "react-redux";
 import { createSearchParams, Link, useNavigate, useSearchParams } from "react-router-dom";
 import { ReactComponent as ShoppingLogo } from "../../../images/shopping-logo.svg";
 import { AuthModal } from "../../common/AuthModal";
@@ -16,7 +16,6 @@ const Header = () => {
     const [isCartDrawerOpen, setIsCartDrawerOpen] = useState(false);
     const [isAuthModalOpen, setIsAuthModalOpen] = useState(false);
     const navigate = useNavigate();
-    const dispatch = useDispatch();
     const [searchParams, setSearchParams] = useSearchParams();
     const token = useSelector((state) => state?.auth?.token || null);
 

+ 33 - 17
src/reducers/feedReducer.js

@@ -7,7 +7,7 @@ import { actionOrdersFind } from "../actions/actionOrdersFind";
 import { actionCategoryGoods } from "../actions/actionCategoryGoods";
 import { actionUsersFind } from "../actions/actionUsersFind";
 import { actionUsersAll } from "../actions/actionUsersAll";
-import { put, takeLatest } from "redux-saga/effects";
+import { put, takeLatest, takeLeading } from "redux-saga/effects";
 
 function feedReducer(state = { payload: [] }, { type, payload = [] }) {
     if (type === "FEED_ADD") {
@@ -25,11 +25,16 @@ function feedReducer(state = { payload: [] }, { type, payload = [] }) {
 
 const actionFeedAdd = (payload) => ({ type: "FEED_ADD", payload });
 const actionFeedClear = () => ({ type: "FEED_CLEAR" });
-const actionFeedGoods =
-    ({ skip = 0, orderBy = "_id" }) =>
-    async (dispatch, getState) => {
-        await dispatch(actionGoodsAll({ skip, limit: 1, promiseName: "feedGoodsAll", orderBy }));
-    };
+
+const actionFeedGoods = ({ skip = 0, orderBy = "_id" } = {}) => ({
+    type: "FEED_GOODS",
+    payload: { skip, orderBy },
+});
+
+function* feedGoodsWorker(action) {
+    const { skip = 0, orderBy = "_id" } = action.payload || {};
+    yield put(actionGoodsAll({ skip, limit: 1, promiseName: "feedGoodsAll", orderBy }));
+}
 
 const actionFeedCategoryGoods = ({ skip = 0, orderBy = "_id", category } = {}) => ({
     type: "FEED_CATEGORY_GOODS",
@@ -42,11 +47,15 @@ function* feedCategoryGoodsWorker(action) {
     yield put(actionCategoryGoods({ skip, limit: 1, promiseName: "feedCategoryGoods", orderBy, category }));
 }
 
-const actionFeedGoodsFind =
-    ({ skip = 0, text = "", orderBy = "_id" }) =>
-    async (dispatch, getState) => {
-        await dispatch(actionGoodsFind({ skip, limit: 1, promiseName: "feedGoodsFind", text, orderBy }));
-    };
+const actionFeedGoodsFind = ({ skip = 0, text = "", orderBy = "_id" } = {}) => ({
+    type: "FEED_GOODS_FIND",
+    payload: { skip, text, orderBy },
+});
+
+function* feedGoodsFindWorker(action) {
+    const { skip = 0, text = "", orderBy = "_id" } = action.payload || {};
+    yield put(actionGoodsFind({ skip, limit: 1, promiseName: "feedGoodsFind", text, orderBy }));
+}
 
 const actionFeedCatsFind =
     ({ skip = 0, text = "", orderBy = "_id" }) =>
@@ -54,11 +63,15 @@ const actionFeedCatsFind =
         await dispatch(actionCatsFind({ skip, promiseName: "feedCatsFind", text, limit: 1, orderBy }));
     };
 
-const actionFeedCats =
-    ({ skip = 0, orderBy = "_id" }) =>
-    async (dispatch, getState) => {
-        await dispatch(actionCatAll({ promiseName: "feedCatAll", skip, limit: 1, orderBy }));
-    };
+const actionFeedCats = ({ skip = 0, orderBy = "_id" } = {}) => ({
+    type: "FEED_CATS",
+    payload: { skip, orderBy },
+});
+
+function* feedCatsWorker(action) {
+    const { skip = 0, orderBy = "_id" } = action.payload || {};
+    yield put(actionCatAll({ promiseName: "feedCatAll", skip, limit: 1, orderBy }));
+}
 
 const actionFeedOrders =
     ({ skip = 0, orderBy = "_id", status = 0 }) =>
@@ -100,5 +113,8 @@ export {
 };
 
 export function* feedWatcher() {
-    yield takeLatest("FEED_CATEGORY_GOODS", feedCategoryGoodsWorker);
+    yield takeLeading("FEED_CATEGORY_GOODS", feedCategoryGoodsWorker);
+    yield takeLeading("FEED_GOODS_FIND", feedGoodsFindWorker);
+    yield takeLeading("FEED_GOODS", feedGoodsWorker);
+    yield takeLeading("FEED_CATS", feedCatsWorker);
 }

+ 10 - 0
src/reducers/promiseReducer.js

@@ -1,7 +1,12 @@
 import { put, takeEvery, takeLatest } from "redux-saga/effects";
 import { aboutMeWorker } from "../actions/actionAboutMe";
 import { catByIdFullWorker } from "../actions/actionCatByIdFull";
+import { categoriesPageWorker } from "../actions/actionCategoriesPage";
 import { categoryGoodsWorker } from "../actions/actionCategoryGoods";
+import { goodPageWorker } from "../actions/actionGoodPage";
+import { goodsFindWorker } from "../actions/actionGoodsFind";
+import { goodsPageWorker } from "../actions/actionGoodsPage";
+import { goodsSearchPageWorker } from "../actions/actionGoodsSearchPage";
 import { orderUpdateWorker } from "../actions/actionOrderUpdate";
 import { pageStartWorker } from "../actions/actionPageStart";
 
@@ -45,4 +50,9 @@ export function* promiseWatcher() {
     yield takeLatest("CAT_BY_ID_FULL", catByIdFullWorker);
     yield takeLatest("CATEGORY_GOODS", categoryGoodsWorker);
     yield takeLatest("ORDER_UPDATE", orderUpdateWorker);
+    yield takeLatest("GOODS_FIND", goodsFindWorker);
+    yield takeLatest("GOOD_PAGE", goodPageWorker);
+    yield takeLatest("GOODS_SEARCH_PAGE", goodsSearchPageWorker);
+    yield takeLatest("CATEGORIES_PAGE", categoriesPageWorker);
+    yield takeLatest("GOODS_PAGE", goodsPageWorker);
 }