From f62b0397c8e7e97ae952f11ffe8864ad403f94cd Mon Sep 17 00:00:00 2001 From: Shivam Mishra Date: Wed, 5 Jul 2023 17:46:41 +0530 Subject: [PATCH] feat: link update method --- .../conversation/LabelSuggestion.vue | 27 +++++++++++++------ 1 file changed, 19 insertions(+), 8 deletions(-) diff --git a/app/javascript/dashboard/components/widgets/conversation/conversation/LabelSuggestion.vue b/app/javascript/dashboard/components/widgets/conversation/conversation/LabelSuggestion.vue index 7c288b7f3..a1f6aca8b 100644 --- a/app/javascript/dashboard/components/widgets/conversation/conversation/LabelSuggestion.vue +++ b/app/javascript/dashboard/components/widgets/conversation/conversation/LabelSuggestion.vue @@ -9,7 +9,14 @@ :key="label.title" @click="addLabel(label.title)" > - + label.title) - ); + let labelsToAdd = this.selectedLabels; + if (!labelsToAdd.length) { + labelsToAdd = this.preparedLabels.map(label => label.title); } + this.$store.dispatch('conversationLabels/update', { + conversationId: this.conversationId, + labels: labelsToAdd, + }); }, }, };