feat(conversations): complete manual AI takeover
This commit is contained in:
@@ -59,13 +59,25 @@ export function useBulkActions() {
|
||||
// Same method used in context menu, conversationId being passed from there.
|
||||
async function onAssignAgent(agent, conversationId = null) {
|
||||
try {
|
||||
await store.dispatch('bulkActions/process', {
|
||||
type: 'Conversation',
|
||||
ids: conversationId || selectedConversations.value,
|
||||
fields: {
|
||||
assignee_id: agent.id,
|
||||
},
|
||||
});
|
||||
if (conversationId && agent.assignee_type === 'AgentBot') {
|
||||
await Promise.all(
|
||||
conversationId.map(id =>
|
||||
store.dispatch('assignAgent', {
|
||||
conversationId: id,
|
||||
agentId: agent.id,
|
||||
assigneeType: agent.assignee_type,
|
||||
})
|
||||
)
|
||||
);
|
||||
} else {
|
||||
await store.dispatch('bulkActions/process', {
|
||||
type: 'Conversation',
|
||||
ids: conversationId || selectedConversations.value,
|
||||
fields: {
|
||||
assignee_id: agent.id,
|
||||
},
|
||||
});
|
||||
}
|
||||
store.dispatch('bulkActions/clearSelectedConversationIds');
|
||||
if (conversationId) {
|
||||
useAlert(
|
||||
|
||||
Reference in New Issue
Block a user