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 }); } });