Feat: Assign conversations to teams. (#1849)

This commit is contained in:
Nithin David Thomas
2021-03-15 18:37:03 +05:30
committed by GitHub
parent 941d4219f0
commit c99c63cd79
10 changed files with 231 additions and 12 deletions

View File

@@ -103,18 +103,38 @@ const actions = {
}
},
assignAgent: async ({ commit }, { conversationId, agentId }) => {
assignAgent: async ({ dispatch }, { conversationId, agentId }) => {
try {
const response = await ConversationApi.assignAgent({
conversationId,
agentId,
});
commit(types.default.ASSIGN_AGENT, response.data);
dispatch('setCurrentChatAssignee', response.data);
} catch (error) {
// Handle error
}
},
setCurrentChatAssignee({ commit }, assignee) {
commit(types.default.ASSIGN_AGENT, assignee);
},
assignTeam: async ({ dispatch }, { conversationId, teamId }) => {
try {
const response = await ConversationApi.assignTeam({
conversationId,
teamId,
});
dispatch('setCurrentChatTeam', response.data);
} catch (error) {
// Handle error
}
},
setCurrentChatTeam({ commit }, team) {
commit(types.default.ASSIGN_TEAM, team);
},
toggleStatus: async ({ commit }, data) => {
try {
const response = await ConversationApi.toggleStatus(data);