mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-27 01:43:22 +00:00
Fix publishing all enterprises when listing catalog
This commit is contained in:
@@ -9,13 +9,11 @@ module DfcProvider
|
||||
def index
|
||||
require_permission "ReadProducts"
|
||||
|
||||
enterprises = current_user.enterprises.map do |enterprise|
|
||||
EnterpriseBuilder.enterprise(enterprise)
|
||||
end
|
||||
catalog_items = enterprises.flat_map(&:catalogItems)
|
||||
enterprise = EnterpriseBuilder.enterprise(current_enterprise)
|
||||
catalog_items = enterprise.catalogItems
|
||||
|
||||
render json: DfcIo.export(
|
||||
*enterprises,
|
||||
enterprise,
|
||||
*catalog_items,
|
||||
*catalog_items.map(&:product),
|
||||
*catalog_items.map(&:product).flat_map(&:isVariantOf),
|
||||
|
||||
@@ -89,8 +89,6 @@ RSpec.describe "CatalogItems", swagger_doc: "dfc.yaml" do
|
||||
id: 10_001, owner: user, name: "Fred's Icecream", description: "Yum",
|
||||
address: build(:address, id: 40_001),
|
||||
)
|
||||
|
||||
pending "Fix publishing all enterprises!!!"
|
||||
end
|
||||
|
||||
run_test! do
|
||||
|
||||
Reference in New Issue
Block a user