From 29e75b87b8a8719c3b0a141a7d37ca4502cf1e4d Mon Sep 17 00:00:00 2001 From: Subhasis Chakraborti Date: Fri, 8 Dec 2023 20:58:16 -0500 Subject: [PATCH] Fix organization asset sending bug --- backend/services/partnerNetwork/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/services/partnerNetwork/index.js b/backend/services/partnerNetwork/index.js index 48b74c23..4d6e83c8 100644 --- a/backend/services/partnerNetwork/index.js +++ b/backend/services/partnerNetwork/index.js @@ -304,7 +304,7 @@ async function getOrganizationAssets(organizationId, assetType, characteristics, (asset.serviceProvider?.organization?._id === organizationId || asset.organization?._id === organizationId) && (asset.shareability === 'Shareable with all organizations' || (asset.shareability === 'Shareable with partner organizations' - && (asset.partnerOrganizations.some(org => partnerOrganizations.includes(org)) + && (asset.partnerOrganizations?.some(org => partnerOrganizations.includes(org)) || asset.partnerOrganizations.map(org => org._uri).some(org => partnerOrganizations.includes(org)))) || (assetType === 'service' && programs.map(program => program.id).includes(asset.program?.split('_')[1]))) ));