fix:call API
This commit is contained in:
parent
ca7e5b247e
commit
559b03c2f0
1 changed files with 18 additions and 2 deletions
|
|
@ -135,8 +135,24 @@ async function fetchDataCommand(type: string) {
|
||||||
dataAttachment.value = data;
|
dataAttachment.value = data;
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.catch((e) => {
|
.catch(async (e) => {
|
||||||
messageError($q, e);
|
if (type !== "cover") {
|
||||||
|
try {
|
||||||
|
const res = await http.get(
|
||||||
|
config.API.fileByFile(
|
||||||
|
"ระบบออกคำสั่ง",
|
||||||
|
newType,
|
||||||
|
commandId.value,
|
||||||
|
newType
|
||||||
|
)
|
||||||
|
);
|
||||||
|
dataAttachment.value = res.data;
|
||||||
|
} catch (error) {
|
||||||
|
messageError($q, e);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
messageError($q, e);
|
||||||
|
}
|
||||||
})
|
})
|
||||||
.finally(() => {
|
.finally(() => {
|
||||||
hideLoader();
|
hideLoader();
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue