Fix product and variant api serializer

This commit is contained in:
Gaetan Craig-Riou
2024-07-08 15:22:08 +10:00
parent cd74a73680
commit b1b534aa1b
2 changed files with 3 additions and 3 deletions

View File

@@ -3,8 +3,7 @@
module Api
module Admin
class ProductSerializer < ActiveModel::Serializer
attributes :id, :name, :sku, :variant_unit, :variant_unit_scale, :variant_unit_name,
:inherits_properties, :on_hand, :price, :import_date, :image_url,
attributes :id, :name, :sku, :inherits_properties, :on_hand, :price, :import_date, :image_url,
:thumb_url, :variants
def variants

View File

@@ -6,7 +6,8 @@ module Api
attributes :id, :name, :producer_name, :image, :sku, :import_date, :tax_category_id,
:options_text, :unit_value, :unit_description, :unit_to_display,
:display_as, :display_name, :name_to_display, :variant_overrides_count,
:price, :on_demand, :on_hand, :in_stock, :stock_location_id, :stock_location_name
:price, :on_demand, :on_hand, :in_stock, :stock_location_id, :stock_location_name,
:variant_unit, :variant_unit_scale, :variant_unit_name, :variant_unit_with_scale
has_one :primary_taxon, key: :category_id, embed: :id
has_one :supplier, key: :producer_id, embed: :id