mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-24 20:36:49 +00:00
Use serialized_data
This commit is contained in:
@@ -18,11 +18,11 @@ module DfcProvider
|
||||
inventory_variants.
|
||||
includes(:product, :inventory_items)
|
||||
|
||||
products_json = ::DfcProvider::ProductSerializer.
|
||||
serialized_data = ::DfcProvider::ProductSerializer.
|
||||
new(products, base_url).
|
||||
serialized_json
|
||||
serialized_data
|
||||
|
||||
render json: products_json
|
||||
render json: serialized_data
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
@@ -9,7 +9,7 @@ module DfcProvider
|
||||
@base_url = base_url
|
||||
end
|
||||
|
||||
def serialized_json
|
||||
def serialized_data
|
||||
{
|
||||
"@context" =>
|
||||
{
|
||||
@@ -18,7 +18,7 @@ module DfcProvider
|
||||
},
|
||||
"@id" => "/enterprise/products",
|
||||
"DFC:supplies" => serialized_products
|
||||
}.to_json
|
||||
}
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
Reference in New Issue
Block a user