updated send message to admin
This commit is contained in:
parent
a987e7565f
commit
a201594756
1 changed files with 28 additions and 23 deletions
|
|
@ -41,29 +41,34 @@ const body = ref<string>(""); //ข้อความ
|
|||
* ยืนยันการจตอบกลับการส่งข้อความ
|
||||
*/
|
||||
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() {
|
|||
<div class="col-xs-12">
|
||||
<div class="col-12 row q-py-sm items-center q-col-gutter-sm">
|
||||
<q-input
|
||||
class="full-width inputgreen cursor-pointer"
|
||||
class="full-width inputgreen cursor-pointer bg-white"
|
||||
hide-bottom-space
|
||||
outlined
|
||||
dense
|
||||
|
|
@ -103,7 +108,7 @@ function onClose() {
|
|||
|
||||
<q-input
|
||||
type="textarea"
|
||||
class="full-width inputgreen cursor-pointer"
|
||||
class="full-width inputgreen cursor-pointer bg-white"
|
||||
hide-bottom-space
|
||||
outlined
|
||||
dense
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue