feat: Allow agents to bulk assign labels to conversations (#4854)
Co-authored-by: Pranav Raj S <pranav@chatwoot.com>
This commit is contained in:
parent
fdcaed75f6
commit
067c905329
5 changed files with 334 additions and 4 deletions
|
@ -95,6 +95,7 @@
|
|||
@select-all-conversations="selectAllConversations"
|
||||
@assign-agent="onAssignAgent"
|
||||
@update-conversations="onUpdateConversations"
|
||||
@assign-labels="onAssignLabels"
|
||||
/>
|
||||
<div ref="activeConversation" class="conversations-list">
|
||||
<conversation-card
|
||||
|
@ -598,6 +599,21 @@ export default {
|
|||
this.showAlert(this.$t('BULK_ACTION.ASSIGN_FAILED'));
|
||||
}
|
||||
},
|
||||
async onAssignLabels(labels) {
|
||||
try {
|
||||
await this.$store.dispatch('bulkActions/process', {
|
||||
type: 'Conversation',
|
||||
ids: this.selectedConversations,
|
||||
labels: {
|
||||
add: labels,
|
||||
},
|
||||
});
|
||||
this.selectedConversations = [];
|
||||
this.showAlert(this.$t('BULK_ACTION.LABELS.ASSIGN_SUCCESFUL'));
|
||||
} catch (err) {
|
||||
this.showAlert(this.$t('BULK_ACTION.LABELS.ASSIGN_FAILED'));
|
||||
}
|
||||
},
|
||||
async onUpdateConversations(status) {
|
||||
try {
|
||||
await this.$store.dispatch('bulkActions/process', {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue