|
|
|
@ -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 ( |
|
|
|
|
<Form> |
|
|
|
|
<FormGroup> |
|
|
|
|
<Label className="capitalize">Upload File</Label> |
|
|
|
|
<Label className="capitalize">Upload File<span style={{ color:'red' }}>*</span></Label> |
|
|
|
|
<Input type="file" onChange={(e) => setFile(e.target.files[0])}/> |
|
|
|
|
<small><span style={{ color:'red' }}>*</span>All Type File Accepted</small> |
|
|
|
|
</FormGroup> |
|
|
|
|
</Form> |
|
|
|
|
) |
|
|
|
|