Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Display contacts for program dupes #2115

Merged
merged 1 commit into from
Dec 27, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading