This commit is contained in:
ivan-sim
2023-12-29 08:58:31 +07:00
parent 62270b6847
commit 2134de863a
2 changed files with 3 additions and 19 deletions

View File

@@ -350,12 +350,12 @@ function handleChangeTab(event: React.SyntheticEvent, newValue: string) {
<Iconify icon="eva:eye-fill" />
View
</MenuItem>
{/* {obj.status === 'approved' ? ( */}
{obj.status === 'approved' ? (
<MenuItem onClick={() => handleDownloadLog(obj.id)}>
<Iconify icon="eva:download-fill" />
Download LOG
</MenuItem>
{/* ):''} */}
):''}
{obj.final_log === 0 && obj.status === 'approved' ? (
<MenuItem onClick={() => handleRequestFinalLog(obj.id, obj.full_name, obj.no_polis, obj.submission_date) }>
<Iconify icon="fa:file-text" />

View File

@@ -39,23 +39,7 @@ export default function TableListFinalLog() {
// Download LOG
async function handleDownloadLog(claimRequest:any) {
return axios
.get(`claim-requests/${claimRequest}/log`, {
responseType: 'blob',
})
.then((response) => {
window.open(URL.createObjectURL(response.data));
// setLoadingLog(false);
})
// .then((blobFile) => {
// new File([blobFile], 'asdads.pdf', { type: blobFile.type })
// setLoadingLog(false);
// })
.catch((response) => {
console.log(response);
enqueueSnackbar(response.message, { variant: 'error' });
// setLoadingLog(false);
});
enqueueSnackbar('Sorry, this feature is currently being processed', { variant: 'error' });
}
/* -------------------------------------------------------------------------- */