diff --git a/app/views/api/product_categories/_product_category.json.jbuilder b/app/views/api/product_categories/_product_category.json.jbuilder index 6cdef711b..641a4d027 100644 --- a/app/views/api/product_categories/_product_category.json.jbuilder +++ b/app/views/api/product_categories/_product_category.json.jbuilder @@ -1,3 +1,4 @@ # frozen_string_literal: true -json.extract! product_category, :id, :name, :slug, :parent_id, :position, :products_count +json.extract! product_category, :id, :name, :slug, :parent_id, :position +json.products_count product_category.try(:products_count)