From 1e718bb5fcb66537aa55d4e585bb2a28f6718a4c Mon Sep 17 00:00:00 2001 From: "DESKTOP-1R2VSQH\\Lenovo ThinkPad E490" Date: Mon, 11 Nov 2024 13:45:24 +0700 Subject: [PATCH] =?UTF-8?q?=E0=B9=80=E0=B8=9E=E0=B8=B4=E0=B9=88=E0=B8=A1?= =?UTF-8?q?=E0=B8=AA=E0=B9=88=E0=B8=87=E0=B8=82=E0=B9=89=E0=B8=AD=E0=B8=84?= =?UTF-8?q?=E0=B8=A7=E0=B8=B2=E0=B8=A1=20inbox?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Dialogs/PopupReplyInbox.vue | 27 ++++++++++++++++-- src/views/Dashboard.vue | 33 ++++++++++++++++++++-- 2 files changed, 55 insertions(+), 5 deletions(-) diff --git a/src/components/Dialogs/PopupReplyInbox.vue b/src/components/Dialogs/PopupReplyInbox.vue index 272140c3..a014bf52 100644 --- a/src/components/Dialogs/PopupReplyInbox.vue +++ b/src/components/Dialogs/PopupReplyInbox.vue @@ -28,6 +28,10 @@ const props = defineProps({ type: Function, default: () => {}, }, + type: { + type: String, + default: "", + }, }); const subject = ref(""); // หัวข้อ @@ -39,14 +43,18 @@ const body = ref(""); //ข้อความ function onSubmit() { dialogConfirm($q, async () => { showLoader(); + const pathAPI = + props.type === "Administrator" + ? config.API.replyMessage(props.idInbox) + : config.API.replyMessage(props.idInbox); await http - .put(config.API.replyMessage(props.idInbox), { + .put(pathAPI, { subject: subject.value, body: body.value, }) .then(() => { - props.clickClose(); success($q, "ส่งข้อความสำเร็จ"); + onClose(); }) .catch((e) => { messageError($q, e); @@ -56,13 +64,26 @@ function onSubmit() { }); }); } + +function onClose() { + subject.value = ""; + body.value = ""; + props.clickClose(); +} + +