NTP-26666| allocation history Failure repoprt changes | avrshitha (#1352)

This commit is contained in:
Podili Varshitha
2025-01-28 17:29:27 +05:30
committed by GitHub
parent 608939de9f
commit 7f822b9cb4

View File

@@ -16,18 +16,12 @@ export const fetchOriginalFile = (referenceId: string) => {
export const fetchFailureReport = (fileReferenceId: string) => {
const url = getApiUrl(ApiKeys.GET_ALLOCATION_FAILURE_REPORT, { referenceId: fileReferenceId });
return axiosInstance
.get(url, {
responseType: 'blob'
})
.get(url)
.then(response => {
const type = response.headers['content-type'];
const contentDisposition: string = response.headers['content-disposition'];
const fileName = contentDisposition.replace('attachment; filename=', '');
const blob = new Blob([response.data], { type });
const link = document.createElement('a');
link.href = window.URL.createObjectURL(blob);
link.download = fileName;
link.click();
getFileDownload(response?.data);
})
.catch(err => {
logError(err);
});
};