From 7b44bf5b78a7d3fb761f55bf91747b02562e4d8c Mon Sep 17 00:00:00 2001 From: Tejaswini Chile Date: Fri, 19 Nov 2021 13:55:40 +0530 Subject: [PATCH] Fix: Filter with label name (#3418) --- app/services/conversations/filter_service.rb | 2 +- spec/services/conversations/filter_service_spec.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/services/conversations/filter_service.rb b/app/services/conversations/filter_service.rb index 5f12bbb6e..d0ee60ca7 100644 --- a/app/services/conversations/filter_service.rb +++ b/app/services/conversations/filter_service.rb @@ -35,7 +35,7 @@ class Conversations::FilterService < FilterService " conversations.additional_attributes ->> '#{attribute_key}' #{filter_operator_value} #{query_operator} " when 'standard' if attribute_key == 'labels' - " tags.id #{filter_operator_value} #{query_operator} " + " tags.name #{filter_operator_value} #{query_operator} " else " conversations.#{attribute_key} #{filter_operator_value} #{query_operator} " end diff --git a/spec/services/conversations/filter_service_spec.rb b/spec/services/conversations/filter_service_spec.rb index 29d6cb2cf..e226e96d5 100644 --- a/spec/services/conversations/filter_service_spec.rb +++ b/spec/services/conversations/filter_service_spec.rb @@ -74,7 +74,7 @@ describe ::Conversations::FilterService do { attribute_key: 'labels', filter_operator: 'equal_to', - values: [1], + values: ['support'], query_operator: nil }.with_indifferent_access ]