diff --git a/src/views/SimproV2/CreatedProyek/DialogFormProyek.js b/src/views/SimproV2/CreatedProyek/DialogFormProyek.js index bb4feaa..22834f2 100644 --- a/src/views/SimproV2/CreatedProyek/DialogFormProyek.js +++ b/src/views/SimproV2/CreatedProyek/DialogFormProyek.js @@ -281,7 +281,7 @@ const DialogFormProyek = ({ currency_symbol: currencySymbol, currency_code: currencyCode, currency_name: currencyName, - company_id: role_name != "Super Admin" ? parseInt(company_id) : parseInt(scompany_id) + company_id: role_name !== "Super Admin" ? parseInt(company_id) : parseInt(scompany_id) }; data.projectCharter = { checklist, issue, potentialRisks, participants, milestones, approval }; data.imageStructureOrg = organization ? organization : null; @@ -312,7 +312,7 @@ const DialogFormProyek = ({ currency_symbol: currencySymbol, currency_code: currencyCode, currency_name: currencyName, - company_id: role_name != "Super Admin" ? parseInt(company_id) : parseInt(scompany_id) + company_id: role_name !== "Super Admin" ? parseInt(company_id) : parseInt(scompany_id) }; data.projectCharter = { checklist, issue, potentialRisks, participants, milestones, approval }; data.imageStructureOrg = organization ? organization : null; diff --git a/src/views/SimproV2/CreatedProyek/index.js b/src/views/SimproV2/CreatedProyek/index.js index e340551..7a73855 100644 --- a/src/views/SimproV2/CreatedProyek/index.js +++ b/src/views/SimproV2/CreatedProyek/index.js @@ -203,12 +203,15 @@ const CreatedProyek = ({ params, ...props }) => { handleGetPhaseProject(); handleGetDivisions(); handleGetDataPm(); - if(role_name === 'Super Admin') { - getDataProyekCompany(); - } } }, [openDialogProyek]); + useEffect(() => { + if(role_name === 'Super Admin') { + getDataProyekCompany(); + } + },[]) + useEffect(() => { if (parseInt(role_id) === 44) { getDataProyekByCustomer() @@ -435,7 +438,7 @@ const CreatedProyek = ({ params, ...props }) => { { name: "company_id", logic_operator: "like", value: parseInt(company_id), operator: "AND" } ); } - if (role_name !== 'Super Admin' && all_project === 'false') { + if (role_name !== 'Super Admin' && all_project === 'false' || role_name !== 'Super Admin' && all_project === 'null') { payload.columns.push( { name: "created_by_id", logic_operator: "IN", value: [JSON.parse(hierarchy)], operator: "AND" } ); @@ -1932,7 +1935,7 @@ const CreatedProyek = ({ params, ...props }) => { dataDivisions={dataDivisions} dataPM={dataPm} projectImage={image} - company_id={companyId} + company_id={company_id} role_name={role_name} companyList={companyList} token={token}