fixing response blob
This commit is contained in:
parent
a27091a81a
commit
74f1540203
25 changed files with 138 additions and 119 deletions
|
|
@ -129,8 +129,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();
|
||||
|
|
@ -161,8 +161,8 @@ const downloadAttachment = 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();
|
||||
|
|
@ -207,14 +207,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);
|
||||
});
|
||||
};
|
||||
// เรียกไฟล์ เอกสารแนบท้าย
|
||||
|
|
@ -228,8 +230,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()));
|
||||
});
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue