From aff377985a58639405118e5f17615af1da30ca5c Mon Sep 17 00:00:00 2001 From: "DESKTOP-1R2VSQH\\Lenovo ThinkPad E490" Date: Tue, 12 Nov 2024 17:07:34 +0700 Subject: [PATCH] API noti-admin --- src/api/00_dashboard/api.message.ts | 2 ++ src/components/Dialogs/PopupReplyInbox.vue | 13 +++++++------ 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/src/api/00_dashboard/api.message.ts b/src/api/00_dashboard/api.message.ts index 8fe705b9..8f7049e2 100644 --- a/src/api/00_dashboard/api.message.ts +++ b/src/api/00_dashboard/api.message.ts @@ -12,5 +12,7 @@ export default { msgId: (id: string) => `${message}/my-notifications/${id}`, msgNoread: () => `${message}/my-notifications/noread`, msgInboxDelete: (id: string) => `${message}/my-inboxes/${id}`, + replyMessage: (id: string) => `${reply}/${id}`, + msgNotiAdmin: `${env.API_URI}/org/profile/noti-admin`, }; diff --git a/src/components/Dialogs/PopupReplyInbox.vue b/src/components/Dialogs/PopupReplyInbox.vue index a014bf52..37600e2b 100644 --- a/src/components/Dialogs/PopupReplyInbox.vue +++ b/src/components/Dialogs/PopupReplyInbox.vue @@ -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();