|
|
@ -6,9 +6,8 @@ import { DOCUMENT_ADD } from '../../../const/ApiConst'; |
|
|
|
import 'antd/dist/antd.css'; |
|
|
|
import 'antd/dist/antd.css'; |
|
|
|
import { NotificationManager } from 'react-notifications'; |
|
|
|
import { NotificationManager } from 'react-notifications'; |
|
|
|
|
|
|
|
|
|
|
|
const DialogRequest = ({ openDialog, closeDialog, toggleDialog, idTask, parentIdNewFolder }) => { |
|
|
|
const DialogRequest = ({ openDialog, closeDialog, toggleDialog, idTask, parentIdNewFolder, token, role_name, companyId }) => { |
|
|
|
const token = localStorage.getItem("token"); |
|
|
|
|
|
|
|
const role = window.localStorage.getItem('role_name'); |
|
|
|
|
|
|
|
const HEADER = { |
|
|
|
const HEADER = { |
|
|
|
headers: { |
|
|
|
headers: { |
|
|
|
"Content-Type": "application/json", |
|
|
|
"Content-Type": "application/json", |
|
|
@ -34,12 +33,9 @@ const DialogRequest = ({ openDialog, closeDialog, toggleDialog, idTask, parentId |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
const uploadDokumen = async () => { |
|
|
|
const uploadDokumen = async () => { |
|
|
|
let configApp = '' |
|
|
|
|
|
|
|
const formData = new FormData; |
|
|
|
const formData = new FormData; |
|
|
|
if (role !== 'Super Admin') { |
|
|
|
|
|
|
|
configApp = JSON.parse(window.localStorage.getItem('configApp')); |
|
|
|
formData.append('company_id', parseInt(companyId)); |
|
|
|
formData.append('company_name',configApp.company_name); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
formData.append('dokumen', file, file.name); |
|
|
|
formData.append('dokumen', file, file.name); |
|
|
|
if (parentIdNewFolder > 0) { |
|
|
|
if (parentIdNewFolder > 0) { |
|
|
|
formData.append('ref_id', parentIdNewFolder); // folder_id
|
|
|
|
formData.append('ref_id', parentIdNewFolder); // folder_id
|
|
|
@ -73,8 +69,9 @@ const DialogRequest = ({ openDialog, closeDialog, toggleDialog, idTask, parentId |
|
|
|
return ( |
|
|
|
return ( |
|
|
|
<Form> |
|
|
|
<Form> |
|
|
|
<FormGroup> |
|
|
|
<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])}/> |
|
|
|
<Input type="file" onChange={(e) => setFile(e.target.files[0])}/> |
|
|
|
|
|
|
|
<small><span style={{ color:'red' }}>*</span>All Type File Accepted</small> |
|
|
|
</FormGroup> |
|
|
|
</FormGroup> |
|
|
|
</Form> |
|
|
|
</Form> |
|
|
|
) |
|
|
|
) |
|
|
|