diff --git a/src/middleware/AuthRoute.jsx b/src/middleware/AuthRoute.jsx index b373a1f..fa9778f 100644 --- a/src/middleware/AuthRoute.jsx +++ b/src/middleware/AuthRoute.jsx @@ -111,6 +111,24 @@ const AuthRoute = ({ redirectPath = "/login", children }) => { } }, []); + //FUNCTION TO GET COMMON HEAD DATA + useEffect(() => { + if((!loggedIn && !isLogin.status) || account_type == 'FAMILY'){ // DO NOT CALL THIS, IF USER ACCOUNT TYPE IS FAMILY + return + } + apiCall + .getHeroJBanners() + .then((res) => { + if (res.data?.internal_return < 0) { + return; + } + dispatch(commonHeadBanner(res.data)); + }) + .catch((error) => { + console.log("ERROR ", error); + }); + }, [isLogin.status, homeBanners]); + useEffect(() => { // FUNCTION TO GET NOTIFICATIONS LIST const notifications = () => { // function to load user notification @@ -231,24 +249,6 @@ const AuthRoute = ({ redirectPath = "/login", children }) => { getMarketActiveJobList(); }, [apiCall, dispatch, marketTableList, isLogin.status]); - //FUNCTION TO GET COMMON HEAD DATA - useEffect(() => { - if((!loggedIn && !isLogin.status) || account_type == 'FAMILY'){ // DO NOT CALL THIS, IF USER ACCOUNT TYPE IS FAMILY - return - } - apiCall - .getHeroJBanners() - .then((res) => { - if (res.data?.internal_return < 0) { - return; - } - dispatch(commonHeadBanner(res.data)); - }) - .catch((error) => { - console.log("ERROR ", error); - }); - }, [isLogin.status, homeBanners]); - //FUNCTION TO GET COMMON HEAD DATA // useEffect(() => { // if((!loggedIn && !isLogin.status) || account_type == 'FAMILY'){ // DO NOT CALL THIS, IF USER ACCOUNT TYPE IS FAMILY