Skip to content

Commit

Permalink
Fix for report linkage
Browse files Browse the repository at this point in the history
  • Loading branch information
arcshiftsolutions committed Sep 16, 2024
1 parent 95ae514 commit 4c30dab
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions backend/src/components/sdc/sdc.js
Original file line number Diff line number Diff line change
Expand Up @@ -872,14 +872,14 @@ async function downloadSdcReport(req, res) {
message: 'Invalid report type provided'
});
}
let collectionId;
let url;
if(req.params.sdcDistrictCollectionID){
collectionId = req.params.sdcDistrictCollectionID;
url = `${config.get('sdc:rootURL')}/reportGeneration/sdcDistrictCollection/${req.params.sdcDistrictCollectionID}/${reportType}`;
} else {
collectionId = req.params.sdcSchoolCollectionID;
url = `${config.get('sdc:rootURL')}/reportGeneration/sdcSchoolCollection/${req.params.sdcSchoolCollectionID}/${reportType}`;
}

const resData = await getData(`${config.get('sdc:rootURL')}/reportGeneration/${collectionId}/${reportType}`);
const resData = await getData(url);
const fileDetails = getFileDetails(reportType);

setResponseHeaders(res, fileDetails);
Expand Down

0 comments on commit 4c30dab

Please sign in to comment.