From b7c0716e5cffadcd4561fa6ff565478b2b8f8f52 Mon Sep 17 00:00:00 2001 From: Andrew Brown Date: Tue, 17 Dec 2019 17:36:41 -0600 Subject: [PATCH] no need to return weight on suggestion apis --- app/controllers/api/v1/attribute_categories_controller.rb | 2 +- app/controllers/api/v1/attribute_fields_controller.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/controllers/api/v1/attribute_categories_controller.rb b/app/controllers/api/v1/attribute_categories_controller.rb index d76aa56d..228b5801 100644 --- a/app/controllers/api/v1/attribute_categories_controller.rb +++ b/app/controllers/api/v1/attribute_categories_controller.rb @@ -6,7 +6,7 @@ module Api entity_type: params.fetch(:entity_type, '').downcase ).order('weight desc').limit( AttributeCategorySuggestion::SUGGESTIONS_RESULT_COUNT - ).pluck(:suggestion, :weight) + ).pluck(:suggestion) if suggestions.empty? CacheMostUsedAttributeCategoriesJob.perform_later( diff --git a/app/controllers/api/v1/attribute_fields_controller.rb b/app/controllers/api/v1/attribute_fields_controller.rb index ced52181..d75821cb 100644 --- a/app/controllers/api/v1/attribute_fields_controller.rb +++ b/app/controllers/api/v1/attribute_fields_controller.rb @@ -7,7 +7,7 @@ module Api category_label: params.fetch(:category, '').downcase ).order('weight desc').limit( AttributeFieldSuggestion::SUGGESTIONS_RESULT_COUNT - ).pluck(:suggestion, :weight) + ).pluck(:suggestion) if suggestions.empty? CacheMostUsedAttributeFieldsJob.perform_later(