API noti-admin

This commit is contained in:
DESKTOP-1R2VSQH\Lenovo ThinkPad E490 2024-11-12 17:07:34 +07:00
parent de0f477291
commit aff377985a
2 changed files with 9 additions and 6 deletions

View file

@ -45,13 +45,14 @@ function onSubmit() {
showLoader();
const pathAPI =
props.type === "Administrator"
? config.API.replyMessage(props.idInbox)
? config.API.msgNotiAdmin
: config.API.replyMessage(props.idInbox);
await http
.put(pathAPI, {
subject: subject.value,
body: body.value,
})
const method = props.type === "Administrator" ? http.post : http.put;
await method(pathAPI, {
subject: subject.value,
body: body.value,
})
.then(() => {
success($q, "ส่งข้อความสำเร็จ");
onClose();