fixing response error message for response type blob

This commit is contained in:
Warunee Tamkoo 2024-06-14 10:59:54 +07:00
parent 6375b446d2
commit a27091a81a
6 changed files with 157 additions and 139 deletions

View file

@ -386,8 +386,8 @@ const downloadExam = async () => {
// start download
a.click();
})
.catch((e) => {
messageError($q, e);
.catch(async (e) => {
messageError($q, JSON.parse(await e.response.data.text()));
})
.finally(() => {
hideLoader();
@ -407,14 +407,8 @@ const downloadPassExam = async () => {
// start download
a.click();
})
.catch((e) => {
messageError(
$q,
e,
rows.value.length == 0
? "ไม่พบข้อมูลผลการสอบ กรุณาตรวจสอบความถูกต้องอีกครั้ง!"
: ""
);
.catch(async (e) => {
messageError($q, JSON.parse(await e.response.data.text()));
})
.finally(() => {
hideLoader();
@ -434,14 +428,8 @@ const downloadPassResultExam = async () => {
// start download
a.click();
})
.catch((e) => {
messageError(
$q,
e,
rows.value.length == 0
? "ไม่พบข้อมูลผลการสอบ กรุณาตรวจสอบความถูกต้องอีกครั้ง!"
: ""
);
.catch(async (e) => {
messageError($q, JSON.parse(await e.response.data.text()));
})
.finally(() => {
hideLoader();