bugs fix
This commit is contained in:
@@ -74,7 +74,7 @@ export default function List() {
|
||||
};
|
||||
|
||||
const handleImportButton = () => {
|
||||
if (importForm?.current) {
|
||||
if (importForm?.current) {;
|
||||
handleClose();
|
||||
importForm.current ? importForm.current.click() : console.log('No File selected');
|
||||
} else {
|
||||
@@ -88,7 +88,7 @@ export default function List() {
|
||||
}
|
||||
|
||||
const handleGetTemplate = (type: string) => {
|
||||
axios.get('corporate/import-document-example/' + type)
|
||||
axios.get('corporates/import-document-example/' + type)
|
||||
.then((response) => {
|
||||
const link = document.createElement('a');
|
||||
link.href = response.data.data.file_url;
|
||||
@@ -127,7 +127,7 @@ export default function List() {
|
||||
if (importForm.current?.files?.length) {
|
||||
const formData = new FormData();
|
||||
formData.append('file', importForm.current?.files[0])
|
||||
axios.post(`master/formularium/${formularium_template_id}/import`, formData )
|
||||
axios.post(`master/formulariums/${formularium_template_id}/import`, formData )
|
||||
.then(response => {
|
||||
handleCancelImportButton();
|
||||
loadDataTableData();
|
||||
@@ -181,7 +181,7 @@ export default function List() {
|
||||
'aria-labelledby': 'basic-button',
|
||||
}}
|
||||
>
|
||||
<MenuItem onClick={() => handleImportButton}>Import</MenuItem>
|
||||
<MenuItem onClick={handleImportButton}>Import</MenuItem>
|
||||
<MenuItem onClick={() => handleGetTemplate('master-formularium')}>Download Template</MenuItem>
|
||||
<MenuItem onClick={() => handleFormulariumList()}>Download Formularium</MenuItem>
|
||||
</Menu>
|
||||
|
||||
Reference in New Issue
Block a user