diff --git a/src/views/Dashboard/DashboardProjectCarousell.js b/src/views/Dashboard/DashboardProjectCarousell.js index e6e020f..774fd2d 100644 --- a/src/views/Dashboard/DashboardProjectCarousell.js +++ b/src/views/Dashboard/DashboardProjectCarousell.js @@ -70,7 +70,15 @@ const center = { }; const DashboardProject = (args) => { - const token = localStorage.getItem("token"); + let role_id = '', user_id = '', proyek_id = '', isLogin = '', token = '', company_id = 0, all_project = '', hierarchy = []; + role_id = localStorage.getItem("role_id"); + proyek_id = localStorage.getItem("proyek_id"); + user_id = localStorage.getItem("user_id"); + token = localStorage.getItem("token"); + isLogin = localStorage.getItem("isLogin"); + company_id = localStorage.getItem('company_id'); + all_project = localStorage.getItem('all_project'); + hierarchy.push(JSON.parse(localStorage.getItem("hierarchy"))); const HEADER = { headers: { "Content-Type": "application/json", @@ -116,7 +124,7 @@ const DashboardProject = (args) => { setIsReadyProjectDetail(false); setIsReadySCurve(false) setIsReadySCurve(false); - const URL = `${BASE_OSPRO}/api/project-carausell`; + const URL = `${BASE_OSPRO}/api/project-carausell/${company_id}/${all_project}/${hierarchy}`; const result = await axios .get(URL, HEADER) .then((res) => res) diff --git a/src/views/SimproV2/CreatedProyek/index.js b/src/views/SimproV2/CreatedProyek/index.js index daa277c..30912f9 100644 --- a/src/views/SimproV2/CreatedProyek/index.js +++ b/src/views/SimproV2/CreatedProyek/index.js @@ -142,7 +142,7 @@ const CreatedProyek = ({ params, ...props }) => { const [userProyek, setUserProyek] = useState([]); const [materialProyek, setMaterialProyek] = useState([]); const [dataCharter, setDataCharter] = useState(null); - const [dataViewStartDate, setDataViewStartDate] = useState([]); + const [dataViewStartDate, setDataViewStartDate] = useState(""); const [materialResource, setMaterialResource] = useState([]); const [toolsResource, setToolsResource] = useState([]); const [dataTypeProyek, setDataTypeProyek] = useState([]); @@ -376,7 +376,7 @@ const CreatedProyek = ({ params, ...props }) => { paging: { start: start, length: rowsPerPage }, }; - if (all_project) { + if (all_project !== null && all_project === true) { payload["columns"] = [ { name: "company_id", logic_operator: "like", value: company_id, operator: "AND" } ]; @@ -512,6 +512,7 @@ const CreatedProyek = ({ params, ...props }) => { }; const handleOpenDialogGantt = (data) => { + console.log('data.mulai_proyek', data.mulai_proyek); setDataViewStartDate(data.mulai_proyek) setidTask(data.id); setProyekName(data.nama); @@ -1534,32 +1535,12 @@ const CreatedProyek = ({ params, ...props }) => { Assign Checklist K3 - {/*