From e89d03cfa2fbad85fb04df0cd031c188704ac97a Mon Sep 17 00:00:00 2001 From: "DESKTOP-1R2VSQH\\Lenovo ThinkPad E490" Date: Tue, 28 May 2024 14:49:06 +0700 Subject: [PATCH] =?UTF-8?q?=E0=B8=81=E0=B8=A5=E0=B9=88=E0=B8=AD=E0=B8=87?= =?UTF-8?q?=E0=B8=82=E0=B9=89=E0=B8=AD=E0=B8=84=E0=B8=A7=E0=B8=B2=E0=B8=A1?= =?UTF-8?q?=20=3D>=20=E0=B8=9B=E0=B8=A3=E0=B8=B1=E0=B8=9A=E0=B8=82?= =?UTF-8?q?=E0=B8=99=E0=B8=B2=E0=B8=94=20Popup?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/PopupReplyInbox.vue | 49 +++++++++---------- .../00_support/components/FormChat.vue | 2 +- 2 files changed, 25 insertions(+), 26 deletions(-) diff --git a/src/components/PopupReplyInbox.vue b/src/components/PopupReplyInbox.vue index 1eed8b2..0cdb863 100644 --- a/src/components/PopupReplyInbox.vue +++ b/src/components/PopupReplyInbox.vue @@ -10,7 +10,7 @@ import { useQuasar } from "quasar"; const mixin = useCounterMixin(); //เรียกฟังก์ชันกลาง const $q = useQuasar(); -const { showLoader, hideLoader, success, messageError } = mixin; +const { showLoader, hideLoader, success, messageError, dialogConfirm } = mixin; const myForm = ref(); const props = defineProps({ @@ -30,35 +30,34 @@ const props = defineProps({ const subject = ref(""); const body = ref(""); -async function submit() { - myForm.value.validate().then(async (result: boolean) => { - if (result) { - // props.savaForm(reason.value); - showLoader(); - await http - .put(config.API.replyMessage(props.idInbox), { - subject: subject.value, - body: body.value, - }) - .then((res) => { - props.clickClose() - success($q, "ส่งข้อความสำเร็จ"); - }) - .catch((e) => { - messageError($q, e); - }) - .finally(() => { - hideLoader(); - }); - } +function onSubmit() { + dialogConfirm($q, () => { + showLoader(); + http + .put(config.API.replyMessage(props.idInbox), { + subject: subject.value, + body: body.value, + }) + .then(() => { + props.clickClose(); + success($q, "ส่งข้อความสำเร็จ"); + }) + .catch((e) => { + messageError($q, e); + }) + .finally(() => { + hideLoader(); + }); }); }