fixing response blob
This commit is contained in:
parent
a27091a81a
commit
74f1540203
25 changed files with 138 additions and 119 deletions
|
|
@ -145,8 +145,8 @@ const downloadCover = async (type: string) => {
|
|||
.then(async (res) => {
|
||||
downloadFile(res, `คำสั่ง ${orderName.value}.${type}`);
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
.catch(async (e) => {
|
||||
messageError($q, JSON.parse(await e.response.data.text()));
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
|
|
@ -206,14 +206,16 @@ const fetchReportCover = async (type: string, orderId: string) => {
|
|||
viewPDF(orderCoverPdf.value);
|
||||
}
|
||||
})
|
||||
.catch((err) => {
|
||||
messageError($q, err);
|
||||
.catch(async (e) => {
|
||||
messageError($q, JSON.parse(await e.response.data.text()));
|
||||
})
|
||||
.finally(() => {});
|
||||
}
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
.catch(async (e) => {
|
||||
!genReportStatus.value
|
||||
? messageError($q, JSON.parse(await e.response.data.text()))
|
||||
: messageError($q, e);
|
||||
});
|
||||
};
|
||||
// เรียกไฟล์ เอกสารแนบท้าย
|
||||
|
|
@ -227,8 +229,8 @@ const fetchReportAttachment = async (type: string, orderId: string) => {
|
|||
const objectUrl = URL.createObjectURL(blob);
|
||||
orderAttachmentPdf.value = objectUrl;
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
.catch(async (e) => {
|
||||
messageError($q, JSON.parse(await e.response.data.text()));
|
||||
});
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -212,8 +212,8 @@ function downloadFile(url: string, type: string, fileName: string) {
|
|||
a.download = fileName;
|
||||
a.click();
|
||||
})
|
||||
.catch((err) => {
|
||||
messageError($q, err);
|
||||
.catch(async (e) => {
|
||||
messageError($q, JSON.parse(await e.response.data.text()));
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
|
|
|
|||
|
|
@ -174,8 +174,8 @@ async function downloadFile(url: string, type: string, fileName: string) {
|
|||
a.download = fileName;
|
||||
a.click();
|
||||
})
|
||||
.catch((err) => {
|
||||
messageError($q, err);
|
||||
.catch(async (e) => {
|
||||
messageError($q, JSON.parse(await e.response.data.text()));
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue