From 559b03c2f06369f7eb16bd49390f46e688b6fb33 Mon Sep 17 00:00:00 2001 From: "DESKTOP-1R2VSQH\\Lenovo ThinkPad E490" Date: Fri, 13 Feb 2026 14:46:51 +0700 Subject: [PATCH] fix:call API --- .../components/DialogPreviewCommand.vue | 20 +++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/src/modules/18_command/components/DialogPreviewCommand.vue b/src/modules/18_command/components/DialogPreviewCommand.vue index d0072270c..64e10f9bb 100644 --- a/src/modules/18_command/components/DialogPreviewCommand.vue +++ b/src/modules/18_command/components/DialogPreviewCommand.vue @@ -135,8 +135,24 @@ async function fetchDataCommand(type: string) { dataAttachment.value = data; } }) - .catch((e) => { - messageError($q, e); + .catch(async (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(() => { hideLoader();