diff --git a/src/views/SimproV2/CreatedProyek/FormDocument.js b/src/views/SimproV2/CreatedProyek/FormDocument.js index d3f4379..fbeecac 100644 --- a/src/views/SimproV2/CreatedProyek/FormDocument.js +++ b/src/views/SimproV2/CreatedProyek/FormDocument.js @@ -6,9 +6,8 @@ import { DOCUMENT_ADD } from '../../../const/ApiConst'; import 'antd/dist/antd.css'; import { NotificationManager } from 'react-notifications'; -const DialogRequest = ({ openDialog, closeDialog, toggleDialog, idTask, parentIdNewFolder }) => { - const token = localStorage.getItem("token"); - const role = window.localStorage.getItem('role_name'); +const DialogRequest = ({ openDialog, closeDialog, toggleDialog, idTask, parentIdNewFolder, token, role_name, companyId }) => { + const HEADER = { headers: { "Content-Type": "application/json", @@ -34,12 +33,9 @@ const DialogRequest = ({ openDialog, closeDialog, toggleDialog, idTask, parentId } const uploadDokumen = async () => { - let configApp = '' const formData = new FormData; - if (role !== 'Super Admin') { - configApp = JSON.parse(window.localStorage.getItem('configApp')); - formData.append('company_name',configApp.company_name); - } + + formData.append('company_id', parseInt(companyId)); formData.append('dokumen', file, file.name); if (parentIdNewFolder > 0) { formData.append('ref_id', parentIdNewFolder); // folder_id @@ -73,8 +69,9 @@ const DialogRequest = ({ openDialog, closeDialog, toggleDialog, idTask, parentId return (
- - setFile(e.target.files[0])} /> + + setFile(e.target.files[0])}/> + *All Type File Accepted
) diff --git a/src/views/SimproV2/CreatedProyek/FormFolderDocument.js b/src/views/SimproV2/CreatedProyek/FormFolderDocument.js index 32fe696..2ea5c7b 100644 --- a/src/views/SimproV2/CreatedProyek/FormFolderDocument.js +++ b/src/views/SimproV2/CreatedProyek/FormFolderDocument.js @@ -33,10 +33,6 @@ const DialogRequestFolder = ({ openDialog, closeDialog, toggleDialog, idTask, pa } const saveFolder = async () => { - - - - let payload = { "proyek_id": idTask, "name_folder": folderName