From a20159475617a8dcabaa4428bfea9bbcb301a7cc Mon Sep 17 00:00:00 2001 From: waruneeauy Date: Wed, 13 Nov 2024 11:02:08 +0700 Subject: [PATCH] updated send message to admin --- src/components/Dialogs/PopupReplyInbox.vue | 51 ++++++++++++---------- 1 file changed, 28 insertions(+), 23 deletions(-) diff --git a/src/components/Dialogs/PopupReplyInbox.vue b/src/components/Dialogs/PopupReplyInbox.vue index 37600e2b..e8daf23c 100644 --- a/src/components/Dialogs/PopupReplyInbox.vue +++ b/src/components/Dialogs/PopupReplyInbox.vue @@ -41,29 +41,34 @@ const body = ref(""); //ข้อความ * ยืนยันการจตอบกลับการส่งข้อความ */ function onSubmit() { - dialogConfirm($q, async () => { - showLoader(); - const pathAPI = - props.type === "Administrator" - ? config.API.msgNotiAdmin - : config.API.replyMessage(props.idInbox); - const method = props.type === "Administrator" ? http.post : http.put; + dialogConfirm( + $q, + async () => { + showLoader(); + const pathAPI = + props.type === "Administrator" + ? config.API.msgNotiAdmin + : config.API.replyMessage(props.idInbox); + const method = props.type === "Administrator" ? http.post : http.put; - await method(pathAPI, { - subject: subject.value, - body: body.value, - }) - .then(() => { - success($q, "ส่งข้อความสำเร็จ"); - onClose(); + await method(pathAPI, { + subject: subject.value, + body: body.value, }) - .catch((e) => { - messageError($q, e); - }) - .finally(() => { - hideLoader(); - }); - }); + .then(() => { + success($q, "ส่งข้อความสำเร็จ"); + onClose(); + }) + .catch((e) => { + messageError($q, e); + }) + .finally(() => { + hideLoader(); + }); + }, + "ยืนยันการส่งข้อความ", + "คุณต้องการส่งข้อความใช่หรือไม่?" + ); } function onClose() { @@ -91,7 +96,7 @@ function onClose() {