From 20da340bf73cd02e9d352b6c485064ec42c688dc Mon Sep 17 00:00:00 2001 From: Skylar Grant Date: Thu, 12 Sep 2024 13:47:59 -0400 Subject: [PATCH] ? --- mccs-it/thermal/app.js | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/mccs-it/thermal/app.js b/mccs-it/thermal/app.js index a1ea9c2..df3e955 100644 --- a/mccs-it/thermal/app.js +++ b/mccs-it/thermal/app.js @@ -21,9 +21,9 @@ app.post('/print-credentials', async (req, res) => { const infoString = Thermal.generateInfo.credentials(username, studentId); // Generate the PDF, saved to disk - Thermal.generatePdf(infoString).then(resolve => { + Thermal.generatePdf(infoString).then(result => { // Print the document - Thermal.print().then(resolve => { + Thermal.print().then(result => { res.send('PDF sent to printer successfully.'); }).catch(e => { console.error('Failed to start printing process:', e); @@ -79,9 +79,9 @@ app.post('/print-mcc', async (req, res) => { const infoString = Thermal.generateInfo.maineCC(); // Generate the PDF, saved to disk - Thermal.generatePdf(infoString).then(res => { + Thermal.generatePdf(infoString).then(result => { // Print the document - Thermal.print().then(res => { + Thermal.print().then(result => { res.send('PDF sent to printer successfully.'); }).catch(e => { console.error('Failed to start printing process:', err); @@ -89,11 +89,11 @@ app.post('/print-mcc', async (req, res) => { }); }).catch(e => { console.error(e); - res.status(500).json({ message: 'Error writing PDF file', error: err.message }); + res.status(500).json({ message: 'Error writing PDF file', error: e.message }); }); - } catch (error) { - console.error('Print Error:', error); - res.status(500).json({ message: 'Print Error', error: error.message }); + } catch (e) { + console.error('Print Error:', e); + res.status(500).json({ message: 'Print Error', error: e.message }); } });