test update2
This commit is contained in:
@@ -51,23 +51,16 @@ function handleChangeTab(event: React.SyntheticEvent, newValue: string) {
|
||||
const [data, setData] = useState([]);
|
||||
|
||||
// Download LOG
|
||||
async function handleDownloadLog(claimRequest:any) {
|
||||
async function handleDownloadLog(request_log_id:any) {
|
||||
return axios
|
||||
.get(`claim-requests/${claimRequest}/log`, {
|
||||
.get(`download-log/${request_log_id}`, {
|
||||
responseType: 'blob',
|
||||
})
|
||||
.then((response) => {
|
||||
window.open(URL.createObjectURL(response.data));
|
||||
// setLoadingLog(false);
|
||||
window.open(URL.createObjectURL(response.data), '_blank');
|
||||
})
|
||||
// .then((blobFile) => {
|
||||
// new File([blobFile], 'asdads.pdf', { type: blobFile.type })
|
||||
// setLoadingLog(false);
|
||||
// })
|
||||
.catch((response) => {
|
||||
console.log(response);
|
||||
enqueueSnackbar(response.message, { variant: 'error' });
|
||||
// setLoadingLog(false);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -358,7 +351,7 @@ function handleChangeTab(event: React.SyntheticEvent, newValue: string) {
|
||||
View
|
||||
</MenuItem>
|
||||
{/* {obj.status === 'approved' ? ( */}
|
||||
<MenuItem onClick={() => handleDownloadLog(38)}>
|
||||
<MenuItem onClick={() => handleDownloadLog(obj.id)}>
|
||||
<Iconify icon="eva:download-fill" />
|
||||
Download LOG
|
||||
</MenuItem>
|
||||
|
||||
Reference in New Issue
Block a user