mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-24 20:36:49 +00:00
Dereferencing product Taxons
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
Darkswarm.factory 'Product', ($resource, Enterprises) ->
|
||||
Darkswarm.factory 'Product', ($resource, Enterprises, Dereferencer, Taxons) ->
|
||||
new class Product
|
||||
constructor: ->
|
||||
@update()
|
||||
@@ -18,3 +18,5 @@ Darkswarm.factory 'Product', ($resource, Enterprises) ->
|
||||
dereference: ->
|
||||
for product in @products
|
||||
product.supplier = Enterprises.enterprises_by_id[product.supplier.id]
|
||||
Dereferencer.dereference product.taxons, Taxons.taxons_by_id
|
||||
|
||||
|
||||
@@ -43,7 +43,7 @@ node :variants do |product|
|
||||
end
|
||||
|
||||
child :taxons => :taxons do |taxon|
|
||||
attributes :name, :id
|
||||
attributes :id
|
||||
end
|
||||
|
||||
child :properties => :properties do |property|
|
||||
|
||||
Reference in New Issue
Block a user