Skip to content

Commit

Permalink
Merge pull request #2115 from bcgov/feature/ShowProgDupeContacts
Browse files Browse the repository at this point in the history
Display contacts for program dupes
  • Loading branch information
alexmcdermid authored Dec 27, 2024
2 parents 3987ec1 + ee79f29 commit accb111
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions backend/src/components/sdc.js
Original file line number Diff line number Diff line change
Expand Up @@ -908,7 +908,7 @@ function setDuplicateResponsePayload(req, sdcDuplicates, isProvincialDuplicate,
async function getUserWithSdcRole(req, sdcDuplicates) {
const token = getAccessToken(req);
for(let sdcDuplicate of sdcDuplicates) {
if(sdcDuplicate.duplicateSeverityCode === 'NON_ALLOW' && sdcDuplicate.duplicateTypeCode === 'ENROLLMENT') {
if(sdcDuplicate.duplicateSeverityCode === 'NON_ALLOW') {
const school1 = cacheService.getSchoolBySchoolID(sdcDuplicate.sdcSchoolCollectionStudent1Entity?.schoolID);
const school2 = cacheService.getSchoolBySchoolID(sdcDuplicate.sdcSchoolCollectionStudent2Entity?.schoolID);
if(!edxUserHasAccessToInstitute(req.session.activeInstituteType, 'SCHOOL', req.session.activeInstituteIdentifier, sdcDuplicate.sdcSchoolCollectionStudent1Entity.schoolID)) {
Expand Down Expand Up @@ -977,7 +977,7 @@ async function getProvincialDuplicatesForSchool(req, res) {
let responseDupe = setDuplicateResponsePayload(req, updatedDupes, true, true);
res.status(HttpStatus.OK).json(responseDupe);
} catch (e) {
log.error('Error retrieving the in district duplicates', e.stack);
log.error('Error retrieving the provincial duplicates', e.stack);
return handleExceptionResponse(e, res);
}
}
Expand All @@ -996,15 +996,15 @@ function updateProvincialDuplicateResponse(req, sdcDuplicate, school1, school2)
if(!edxUserHasAccessToInstitute(req.session.activeInstituteType, 'SCHOOL', req.session.activeInstituteIdentifier, sdcDuplicate.sdcSchoolCollectionStudent1Entity.schoolID)) {
delete sdcDuplicate.sdcSchoolCollectionStudent1Entity.sdcSchoolCollectionStudentID;
delete sdcDuplicate.sdcSchoolCollectionStudent1Entity.sdcSchoolCollectionID;
if(sdcDuplicate.duplicateSeverityCode === 'NON_ALLOW' && sdcDuplicate.duplicateTypeCode === 'ENROLLMENT') {
if(sdcDuplicate.duplicateSeverityCode === 'NON_ALLOW') {
sdcDuplicate.sdcSchoolCollectionStudent1Entity.showContact = true;
}
}

if(!edxUserHasAccessToInstitute(req.session.activeInstituteType, 'SCHOOL', req.session.activeInstituteIdentifier, sdcDuplicate.sdcSchoolCollectionStudent2Entity.schoolID)) {
delete sdcDuplicate.sdcSchoolCollectionStudent2Entity.sdcSchoolCollectionStudentID;
delete sdcDuplicate.sdcSchoolCollectionStudent2Entity.sdcSchoolCollectionID;
if(sdcDuplicate.duplicateSeverityCode === 'NON_ALLOW' && sdcDuplicate.duplicateTypeCode === 'ENROLLMENT') {
if(sdcDuplicate.duplicateSeverityCode === 'NON_ALLOW') {
sdcDuplicate.sdcSchoolCollectionStudent2Entity.showContact = true;
}
}
Expand Down

0 comments on commit accb111

Please sign in to comment.