NTP-26666| allocation history Failure repoprt changes | avrshitha (#1352)
This commit is contained in:
@@ -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);
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user