Browse Source

Remove unnecessary request

pull/2/head
Wahyu Ramadhan 1 year ago
parent
commit
1490c9014c
  1. 7
      src/views/SimproV2/CreatedProyek/DialogGantt.js
  2. 1
      src/views/SimproV2/CreatedProyek/DialogHierarchy.js

7
src/views/SimproV2/CreatedProyek/DialogGantt.js

@ -13,7 +13,7 @@ import DialogUserGantt from './DialogUserGantt';
import { Link } from 'react-router-dom'; import { Link } from 'react-router-dom';
const DialogGantt = ({ openDialog, closeDialog, toggleDialog, idTask, proyekName, hierarchyId, hierarchyName }) => { const DialogGantt = ({ openDialog, closeDialog, toggleDialog, idTask, proyekName, hierarchyId, hierarchyName, openDialogHierarchy }) => {
const token = localStorage.getItem("token") const token = localStorage.getItem("token")
const HEADER = { const HEADER = {
headers: { headers: {
@ -31,10 +31,7 @@ const DialogGantt = ({ openDialog, closeDialog, toggleDialog, idTask, proyekName
const [humanResource, setHumanResource] = useState([]) const [humanResource, setHumanResource] = useState([])
useEffect(() => { useEffect(() => {
if (idTask > 0) { if (hierarchyId > 0 || idTask > 0 && !openDialogHierarchy) {
getdataGantt();
}
if (hierarchyId > 0) {
getdataGantt(); getdataGantt();
} }
}, [hierarchyId, idTask, openDialog]) }, [hierarchyId, idTask, openDialog])

1
src/views/SimproV2/CreatedProyek/DialogHierarchy.js

@ -311,6 +311,7 @@ const DialogHierarchy = ({ openDialog, closeDialog, toggleDialog, idTask, proyek
hierarchyId={parentId} hierarchyId={parentId}
hierarchyName={parentName} hierarchyName={parentName}
idTask={idTask} idTask={idTask}
openDialogHierarchy={openDialog}
/> />
<DialogFormGantt <DialogFormGantt
idTask={idTask} idTask={idTask}

Loading…
Cancel
Save