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(