mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-27 01:43:22 +00:00
Remove Person from product catalog
Early versions of the DFC standard demanded that all data is published in relationship to the authenticated user. But that is not necessary anymore and can add complications when a platform is authenticated as client user.
This commit is contained in:
@@ -7,16 +7,12 @@ module DfcProvider
|
||||
before_action :check_enterprise
|
||||
|
||||
def index
|
||||
person = PersonBuilder.person(current_user)
|
||||
|
||||
enterprises = current_user.enterprises.map do |enterprise|
|
||||
EnterpriseBuilder.enterprise(enterprise)
|
||||
end
|
||||
person.affiliatedOrganizations = enterprises
|
||||
catalog_items = enterprises.flat_map(&:catalogItems)
|
||||
|
||||
render json: DfcIo.export(
|
||||
person,
|
||||
*enterprises,
|
||||
*catalog_items,
|
||||
*catalog_items.map(&:product),
|
||||
|
||||
@@ -151,9 +151,6 @@ paths:
|
||||
value:
|
||||
"@context": https://www.datafoodconsortium.org
|
||||
"@graph":
|
||||
- "@id": http://test.host/api/dfc/persons/12345
|
||||
"@type": dfc-b:Person
|
||||
dfc-b:affiliates: http://test.host/api/dfc/enterprises/10000
|
||||
- "@id": http://test.host/api/dfc/enterprises/10000
|
||||
"@type": dfc-b:Enterprise
|
||||
dfc-b:hasAddress: http://test.host/api/dfc/addresses/40000
|
||||
|
||||
Reference in New Issue
Block a user