This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
router.post('/upreport/:ReId', multer.single('reportfile'), async function (req, res, next) { | |
try{ | |
if (!req.file) { | |
req.flash('error', "Report file not selected") | |
res.redirect('/hospital/report') | |
} else { | |
let doc = await db.collection("request").doc(req.params.ReId) | |
let mailOptions = { | |
from: '4nm17cs141@gmail.com', | |
to: doc.data().email, |