From 0440b36f2438571e3996e90c4d423ba912474d9e Mon Sep 17 00:00:00 2001 From: victorAnumudu Date: Wed, 25 Sep 2024 13:13:19 +0100 Subject: [PATCH] dashdata api removed --- .../Dashboards/FamilyParentDashboard.jsx | 1 - src/components/Dashboards/HomeDashboard.jsx | 2 +- .../Dashboards/JobOwnerDashboard.jsx | 1 - src/components/Dashboards/WorkerDashboard.jsx | 1 - src/components/Home/FullAccountDash.jsx | 4 -- src/components/Home/index.jsx | 37 +++++++------------ 6 files changed, 15 insertions(+), 31 deletions(-) diff --git a/src/components/Dashboards/FamilyParentDashboard.jsx b/src/components/Dashboards/FamilyParentDashboard.jsx index 7fba64a..53279a1 100644 --- a/src/components/Dashboards/FamilyParentDashboard.jsx +++ b/src/components/Dashboards/FamilyParentDashboard.jsx @@ -5,7 +5,6 @@ import { useSelector } from "react-redux"; export default function FamilyParentDashboard({ className, bannerList, - nextDueTask, }) { const { userDetails } = useSelector((state) => state?.userDetails); diff --git a/src/components/Dashboards/HomeDashboard.jsx b/src/components/Dashboards/HomeDashboard.jsx index 35a0d65..911689f 100644 --- a/src/components/Dashboards/HomeDashboard.jsx +++ b/src/components/Dashboards/HomeDashboard.jsx @@ -2,7 +2,7 @@ import React from "react"; // import HomeSliders from "./HomeSliders"; import { useSelector } from "react-redux"; -export default function HomeDashboard({ className, bannerList, nextDueTask }) { +export default function HomeDashboard({ className, bannerList }) { const { userDetails } = useSelector((state) => state?.userDetails); let loginDate = userDetails?.last_login.split(" ")[0]; diff --git a/src/components/Dashboards/JobOwnerDashboard.jsx b/src/components/Dashboards/JobOwnerDashboard.jsx index c26919a..2c2488f 100644 --- a/src/components/Dashboards/JobOwnerDashboard.jsx +++ b/src/components/Dashboards/JobOwnerDashboard.jsx @@ -5,7 +5,6 @@ import { useSelector } from "react-redux"; export default function JobOwnerDashboard({ className, bannerList, - nextDueTask, }) { const { userDetails } = useSelector((state) => state?.userDetails); diff --git a/src/components/Dashboards/WorkerDashboard.jsx b/src/components/Dashboards/WorkerDashboard.jsx index dc0a603..de0c196 100644 --- a/src/components/Dashboards/WorkerDashboard.jsx +++ b/src/components/Dashboards/WorkerDashboard.jsx @@ -5,7 +5,6 @@ import { useSelector } from "react-redux"; export default function WorkerDashboard({ className, bannerList, - nextDueTask, }) { const { userDetails } = useSelector((state) => state?.userDetails); diff --git a/src/components/Home/FullAccountDash.jsx b/src/components/Home/FullAccountDash.jsx index 9cf5528..70eca7d 100644 --- a/src/components/Home/FullAccountDash.jsx +++ b/src/components/Home/FullAccountDash.jsx @@ -22,7 +22,6 @@ export default function FullAccountDash(props) { className="mb-4" data={userDetails} bannerList={props.bannerList} - nextDueTask={props.nextDueTask} /> ); case "FAMILY_PARENT_DASH": @@ -31,7 +30,6 @@ export default function FullAccountDash(props) { className="mb-4" data={userDetails} bannerList={props.bannerList} - nextDueTask={props.nextDueTask} /> ); case "WORKER_HOME_DASH": @@ -40,7 +38,6 @@ export default function FullAccountDash(props) { className="mb-4" data={userDetails} bannerList={props.bannerList} - nextDueTask={props.nextDueTask} /> ); case "JOBOWNER_HOME_DASH": @@ -49,7 +46,6 @@ export default function FullAccountDash(props) { className="mb-4" data={userDetails} bannerList={props.bannerList} - nextDueTask={props.nextDueTask} /> ); default: diff --git a/src/components/Home/index.jsx b/src/components/Home/index.jsx index 6f30cc8..f42b1e4 100644 --- a/src/components/Home/index.jsx +++ b/src/components/Home/index.jsx @@ -12,14 +12,9 @@ export default function Home(props) { const userApi = new usersService(); const { commonHeadBanner } = useSelector((state) => state.commonHeadBanner); - let [nextDueTask, setNextDueTask] = useState({}); - - // const [MyOffersList, setMyOffersList] = useState({loading: true, data: []}); - const { userDetails } = useSelector((state) => state?.userDetails); const [MyActiveJobList, setMyActiveJobList] = useState({loading:true, data:[]}); // STATE TO HOLD ACTIVE/CURRENT TASKS - // const [MyActiveJobList, setMyActiveJobList] = useState([]); // STATE TO HOLD ACTIVE/CURRENT TASKS const getMyActiveJobList = async () => { // FUNCTION TO POPULATE ACTIVE/CURRENT TASK LIST try { @@ -34,19 +29,19 @@ export default function Home(props) { }; // FUNCTION TO GET DASH DATA TO DETERMINE CURRENT TASK DUE TIME - const getHomeDate = () => { - userApi - .getHomeDate() - .then((res) => { - if (res.status != 200 || res.internal_return < 0) { - return; - } - setNextDueTask(res.data); - }) - .catch((error) => { - console.log(error); - }); - }; + // const getHomeDate = () => { + // userApi + // .getHomeDate() + // .then((res) => { + // if (res.status != 200 || res.internal_return < 0) { + // return; + // } + // setNextDueTask(res.data); + // }) + // .catch((error) => { + // console.log(error); + // }); + // }; // const getMyOffersList = async () => { // try { @@ -59,11 +54,8 @@ export default function Home(props) { // }; useEffect(() => { - const fetchData = async () => { - await Promise.all([getHomeDate(), getMyActiveJobList()]); - }; if(userDetails?.account_type == 'FULL'){ - fetchData(); + getMyActiveJobList(); } }, []); @@ -83,7 +75,6 @@ export default function Home(props) { /> ) : userDetails && userDetails?.account_type == "FULL" ? (