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() {
|
function onSubmit() {
|
||||||
dialogConfirm($q, async () => {
|
dialogConfirm(
|
||||||
showLoader();
|
$q,
|
||||||
const pathAPI =
|
async () => {
|
||||||
props.type === "Administrator"
|
showLoader();
|
||||||
? config.API.msgNotiAdmin
|
const pathAPI =
|
||||||
: config.API.replyMessage(props.idInbox);
|
props.type === "Administrator"
|
||||||
const method = props.type === "Administrator" ? http.post : http.put;
|
? config.API.msgNotiAdmin
|
||||||
|
: config.API.replyMessage(props.idInbox);
|
||||||
|
const method = props.type === "Administrator" ? http.post : http.put;
|
||||||
|
|
||||||
await method(pathAPI, {
|
await method(pathAPI, {
|
||||||
subject: subject.value,
|
subject: subject.value,
|
||||||
body: body.value,
|
body: body.value,
|
||||||
})
|
|
||||||
.then(() => {
|
|
||||||
success($q, "ส่งข้อความสำเร็จ");
|
|
||||||
onClose();
|
|
||||||
})
|
})
|
||||||
.catch((e) => {
|
.then(() => {
|
||||||
messageError($q, e);
|
success($q, "ส่งข้อความสำเร็จ");
|
||||||
})
|
onClose();
|
||||||
.finally(() => {
|
})
|
||||||
hideLoader();
|
.catch((e) => {
|
||||||
});
|
messageError($q, e);
|
||||||
});
|
})
|
||||||
|
.finally(() => {
|
||||||
|
hideLoader();
|
||||||
|
});
|
||||||
|
},
|
||||||
|
"ยืนยันการส่งข้อความ",
|
||||||
|
"คุณต้องการส่งข้อความใช่หรือไม่?"
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
function onClose() {
|
function onClose() {
|
||||||
|
|
@ -91,7 +96,7 @@ function onClose() {
|
||||||
<div class="col-xs-12">
|
<div class="col-xs-12">
|
||||||
<div class="col-12 row q-py-sm items-center q-col-gutter-sm">
|
<div class="col-12 row q-py-sm items-center q-col-gutter-sm">
|
||||||
<q-input
|
<q-input
|
||||||
class="full-width inputgreen cursor-pointer"
|
class="full-width inputgreen cursor-pointer bg-white"
|
||||||
hide-bottom-space
|
hide-bottom-space
|
||||||
outlined
|
outlined
|
||||||
dense
|
dense
|
||||||
|
|
@ -103,7 +108,7 @@ function onClose() {
|
||||||
|
|
||||||
<q-input
|
<q-input
|
||||||
type="textarea"
|
type="textarea"
|
||||||
class="full-width inputgreen cursor-pointer"
|
class="full-width inputgreen cursor-pointer bg-white"
|
||||||
hide-bottom-space
|
hide-bottom-space
|
||||||
outlined
|
outlined
|
||||||
dense
|
dense
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue