mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-26 20:56:48 +00:00
Fix invoice and api serializer
This commit is contained in:
@@ -10,7 +10,6 @@ class Api::ProductSerializer < ActiveModel::Serializer
|
||||
has_many :variants, serializer: Api::VariantSerializer
|
||||
|
||||
has_one :image, serializer: Api::ImageSerializer
|
||||
has_one :supplier, serializer: Api::IdSerializer
|
||||
|
||||
# return an unformatted descripton
|
||||
def description
|
||||
|
||||
@@ -9,6 +9,8 @@ class Api::VariantSerializer < ActiveModel::Serializer
|
||||
:tag_list, :thumb_url,
|
||||
:unit_price_price, :unit_price_unit
|
||||
|
||||
has_one :supplier, serializer: Api::IdSerializer
|
||||
|
||||
delegate :price, to: :object
|
||||
|
||||
def fees
|
||||
|
||||
@@ -3,6 +3,5 @@
|
||||
class Invoice
|
||||
class ProductSerializer < ActiveModel::Serializer
|
||||
attributes :name
|
||||
has_one :supplier, serializer: Invoice::EnterpriseSerializer
|
||||
end
|
||||
end
|
||||
|
||||
@@ -4,5 +4,6 @@ class Invoice
|
||||
class VariantSerializer < ActiveModel::Serializer
|
||||
attributes :id, :display_name, :options_text
|
||||
has_one :product, serializer: Invoice::ProductSerializer
|
||||
has_one :supplier, serializer: Invoice::EnterpriseSerializer
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user