Feat: Assign conversations to teams. (#1849)
This commit is contained in:
committed by
GitHub
parent
941d4219f0
commit
c99c63cd79
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user