diff --git a/src/views/Dashboard/DashboardProject.js b/src/views/Dashboard/DashboardProject.js index 9568ab5..a061d1d 100644 --- a/src/views/Dashboard/DashboardProject.js +++ b/src/views/Dashboard/DashboardProject.js @@ -86,6 +86,8 @@ const DashboardProject = () => { const [assignedHrCount, setAssignedHrCount] = useState(0); const [actualHrCount, setActualHrCount] = useState(0); const [dataGantt, setDataGantt] = useState({}); + const [dataGanttParents, setDataGanttParents] = useState({}); + const [isReadyGanttParents, setIsReadyGanttParents] = useState(false); let history = useHistory(); @@ -96,6 +98,7 @@ const DashboardProject = () => { getReportDistribution() getComments() getGantt() + getGanttParents() return () => { console.log('unmount RenderMap'); } @@ -154,6 +157,19 @@ const DashboardProject = () => { } } + const getGanttParents = async () => { + setIsReadyGanttParents(false) + const url = `${BASE_OSPRO}/api/hierarchy-ftths/tree-gantt/${GANTT_ID}` + try { + const response = await axios.get(url, HEADER) + setDataGanttParents(response) + setIsReadyGanttParents(true) + } catch (error) { + console.error('Failed to get gantt data:', error) + setIsReadyGanttParents(true) + } + } + const getAssignedHR = async () => { const url = `${BASE_OSPRO}/api/project/manpower/assigned/${GANTT_ID}` try { @@ -565,7 +581,18 @@ const DashboardProject = () => {