Fix publishing all enterprises when listing catalog

This commit is contained in:
Maikel Linke
2025-09-15 13:54:08 +10:00
parent 06c27d6aaf
commit 44d29e98e0
2 changed files with 3 additions and 7 deletions

View File

@@ -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),

View File

@@ -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