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();