Skip to content

Commit

Permalink
Fix bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
htysc committed Dec 9, 2023
1 parent 29e75b8 commit cb219e6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
4 changes: 2 additions & 2 deletions backend/services/partnerNetwork/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ async function getOrganizationAssets(organizationId, assetType, characteristics,
&& (asset.shareability === 'Shareable with all organizations'
|| (asset.shareability === 'Shareable with partner organizations'
&& (asset.partnerOrganizations?.some(org => partnerOrganizations.includes(org))
|| asset.partnerOrganizations.map(org => org._uri).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])))
));

Expand All @@ -314,7 +314,7 @@ async function getOrganizationAssets(organizationId, assetType, characteristics,

async function sendOrganization(req, res, next) {
try {
const organization = await GDBOrganizationModel.findOne({status: 'Home'}, {populates: ['characteristicOccurrences.occurrenceOf']});
const organization = await GDBOrganizationModel.findOne({status: 'Home'}, {populates: ['characteristicOccurrences.occurrenceOf', 'description']});
if (!organization) {
throw new Error('This deployment has no home organization');
}
Expand Down
1 change: 1 addition & 0 deletions backend/services/partnerNetwork/referrals.js
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,7 @@ async function receiveReferral(req, res, next) {

const referral = {fields: {}, formId: referralFormId};
referral.fields[PredefinedCharacteristics['ID in Partner Deployment']._uri.split('#')[1]] = partnerData.id;
referral.fields[PredefinedCharacteristics['Referral Status']._uri.split('#')[1]] = 'Pending acceptance';
referral.fields[PredefinedInternalTypes['receivingServiceProviderForReferral']._uri.split('#')[1]] = homeServiceProvider._uri;
referral.fields[PredefinedInternalTypes['referringServiceProviderForReferral']._uri.split('#')[1]] = referrerServiceProvider._uri;
referral.fields[PredefinedInternalTypes['programForReferral']._uri.split('#')[1]] = partnerData.program ? 'http://snmi#program_' + partnerData.program?.id : null;
Expand Down

0 comments on commit cb219e6

Please sign in to comment.