From f4c0ce5dfac96e004f3a078aec68dc7244f6e9d7 Mon Sep 17 00:00:00 2001 From: Muhsin Keloth Date: Mon, 7 Feb 2022 13:43:16 +0530 Subject: [PATCH] chore: Assign to agent who create new message from contact panel (#3924) --- .../conversation/contact/ConversationForm.vue | 2 ++ .../dashboard/store/modules/contactConversations.js | 10 +++++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/app/javascript/dashboard/routes/dashboard/conversation/contact/ConversationForm.vue b/app/javascript/dashboard/routes/dashboard/conversation/contact/ConversationForm.vue index 923e6d408..fc0cb1681 100644 --- a/app/javascript/dashboard/routes/dashboard/conversation/contact/ConversationForm.vue +++ b/app/javascript/dashboard/routes/dashboard/conversation/contact/ConversationForm.vue @@ -133,6 +133,7 @@ export default { ...mapGetters({ uiFlags: 'contacts/getUIFlags', conversationsUiFlags: 'contactConversations/getUIFlags', + currentUser: 'getCurrentUser', }), getNewConversation() { return { @@ -141,6 +142,7 @@ export default { contactId: this.contact.id, message: { content: this.message }, mailSubject: this.subject, + assigneeId: this.currentUser.id, }; }, targetInbox: { diff --git a/app/javascript/dashboard/store/modules/contactConversations.js b/app/javascript/dashboard/store/modules/contactConversations.js index 49eeabdc4..50bbb4f99 100644 --- a/app/javascript/dashboard/store/modules/contactConversations.js +++ b/app/javascript/dashboard/store/modules/contactConversations.js @@ -24,7 +24,14 @@ export const actions = { commit(types.default.SET_CONTACT_CONVERSATIONS_UI_FLAG, { isCreating: true, }); - const { inboxId, message, contactId, sourceId, mailSubject } = params; + const { + inboxId, + message, + contactId, + sourceId, + mailSubject, + assigneeId, + } = params; try { const { data } = await ConversationApi.create({ inbox_id: inboxId, @@ -34,6 +41,7 @@ export const actions = { mail_subject: mailSubject, }, message, + assignee_id: assigneeId, }); commit(types.default.ADD_CONTACT_CONVERSATION, { id: contactId,