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';
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 HEADER = {
headers: {
@ -31,10 +31,7 @@ const DialogGantt = ({ openDialog, closeDialog, toggleDialog, idTask, proyekName
const [humanResource, setHumanResource] = useState([])
useEffect(() => {
if (idTask > 0) {
getdataGantt();
}
if (hierarchyId > 0) {
if (hierarchyId > 0 || idTask > 0 && !openDialogHierarchy) {
getdataGantt();
}
}, [hierarchyId, idTask, openDialog])

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

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

Loading…
Cancel
Save