From 97438078fab3dcec1c2142de61310deb79522da9 Mon Sep 17 00:00:00 2001 From: Skylar Grant Date: Fri, 13 Sep 2024 10:05:07 -0400 Subject: [PATCH] ? --- mccs-it/thermal/app.js | 12 +++++++++--- mccs-it/thermal/modules/Thermal.js | 2 +- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/mccs-it/thermal/app.js b/mccs-it/thermal/app.js index 1beb1c3..5d4e348 100644 --- a/mccs-it/thermal/app.js +++ b/mccs-it/thermal/app.js @@ -21,7 +21,9 @@ app.post('/print-credentials', async (req, res) => { const infoArray = Thermal.generateInfo.credentials(username, studentId); // Generate the PDF, saved to disk - Thermal.generatePdf(infoArray).catch(e => { + Thermal.generatePdf(infoArray).then((result) => { + res.status(200).json({ message: 'PDF file written successfully.' }); + }).catch(e => { console.error(e); res.status(500).json({ message: 'Error writing PDF file', error: e.message }); }); @@ -46,7 +48,9 @@ app.post('/print-temp-pw', async (req, res) => { const infoArray = Thermal.generateInfo.tempPassword(password); // Generate the PDF, saved to disk - Thermal.generatePdf(infoArray).catch(e => { + Thermal.generatePdf(infoArray).then((result) => { + res.status(200).json({ message: 'PDF file written successfully.' }); + }).catch(e => { console.error(e); res.status(500).json({ message: 'Error writing PDF file', error: err.message }); }); @@ -63,7 +67,9 @@ app.post('/print-mcc', async (req, res) => { const infoArray = Thermal.generateInfo.maineCC(); // Generate the PDF, saved to disk - Thermal.generatePdf(infoArray).catch(e => { + Thermal.generatePdf(infoArray).then((result) => { + res.status(200).json({ message: 'PDF file written successfully.' }); + }).catch(e => { console.error(e); res.status(500).json({ message: 'Error writing PDF file', error: e.message }); }); diff --git a/mccs-it/thermal/modules/Thermal.js b/mccs-it/thermal/modules/Thermal.js index 180315d..981cba1 100644 --- a/mccs-it/thermal/modules/Thermal.js +++ b/mccs-it/thermal/modules/Thermal.js @@ -48,7 +48,7 @@ module.exports = { return [ { font: 'public/Outfit-Regular.ttf', text: 'We have changed your password to a temporary password, shown below. Next time you log into Microsoft you will be prompted to change your password.\n', moveDownAfter: true }, { font: 'public/Outfit-Regular.ttf', text: 'Temporary Password:', moveDownAfter: false }, - { font: 'public/RobotoMono-SemiBold.ttf', text: `${password}\n`, moveDownAfter: false }, + { font: 'public/RobotoMono-SemiBold.ttf', text: `${password}\n`, moveDownAfter: true }, { font: 'public/Outfit-Regular.ttf', text: 'Password requirements:\n8+ characters\n1+ Uppercase\n1+ Lowercase\n1+ Special (!/_=.,?)\n', moveDownAfter: true } ] }