generate practice summary report; send report to frontend

This commit is contained in:
Bilal Catic
2019-08-08 01:55:00 +02:00
parent 12523fde5b
commit 3f16ec5949
12 changed files with 13279 additions and 10 deletions

View File

@@ -128,10 +128,13 @@ const checkProcessingStatus = (req, res) => {
const getPracticeSummaryReport = (req, res) => {
getMemberPracticeSummaryReport()
.then(() => {
res.send();
.then((result) => {
const pathToDownloadFile = `${__dirname}/../${result.reportPath}`;
res.download(pathToDownloadFile);
})
.catch((error) => {
console.log('Error - Member Practice Summary Report');
console.log(error);
res.status(500).send(error);
});
};