H-16: align takeover with channel AI workflow (#2)
* feat(conversations): complete manual AI takeover * fix(conversations): align AI takeover flow with channel AI * fix(conversations): close takeover review gaps --------- Co-authored-by: Rogee <rogee@ipao.vip>
This commit is contained in:
@@ -219,15 +219,11 @@ const actions = {
|
||||
}
|
||||
},
|
||||
|
||||
assignAgent: async (
|
||||
{ dispatch },
|
||||
{ conversationId, agentId, assigneeType }
|
||||
) => {
|
||||
assignAgent: async ({ dispatch }, { conversationId, agentId }) => {
|
||||
try {
|
||||
const response = await ConversationApi.assignAgent({
|
||||
conversationId,
|
||||
agentId,
|
||||
assigneeType,
|
||||
});
|
||||
dispatch('setCurrentChatAssignee', {
|
||||
conversationId,
|
||||
@@ -238,6 +234,18 @@ const actions = {
|
||||
}
|
||||
},
|
||||
|
||||
startAITakeover: async ({ commit }, conversationId) => {
|
||||
const { data } = await ConversationApi.startAITakeover(conversationId);
|
||||
commit(types.UPDATE_CONVERSATION, data);
|
||||
return data;
|
||||
},
|
||||
|
||||
exitAITakeover: async ({ commit }, conversationId) => {
|
||||
const { data } = await ConversationApi.exitAITakeover(conversationId);
|
||||
commit(types.UPDATE_CONVERSATION, data);
|
||||
return data;
|
||||
},
|
||||
|
||||
setCurrentChatAssignee({ commit }, { conversationId, assignee }) {
|
||||
commit(types.ASSIGN_AGENT, { conversationId, assignee });
|
||||
},
|
||||
@@ -299,7 +307,7 @@ const actions = {
|
||||
|
||||
createPendingMessageAndSend: async ({ dispatch }, data) => {
|
||||
const pendingMessage = createPendingMessage(data);
|
||||
dispatch('sendMessageWithData', pendingMessage);
|
||||
return dispatch('sendMessageWithData', pendingMessage);
|
||||
},
|
||||
|
||||
sendMessageWithData: async ({ commit }, pendingMessage) => {
|
||||
@@ -318,6 +326,7 @@ const actions = {
|
||||
commit(types.ADD_CONVERSATION_ATTACHMENTS, {
|
||||
...response.data,
|
||||
});
|
||||
return response.data;
|
||||
} catch (error) {
|
||||
const errorMessage = error.response
|
||||
? error.response.data.error
|
||||
|
||||
Reference in New Issue
Block a user