From 75874a604056a80c83d5be6ecd51f27c4b1a4210 Mon Sep 17 00:00:00 2001 From: Skylar Grant Date: Fri, 13 Sep 2024 09:23:25 -0400 Subject: [PATCH] ? --- mccs-it/thermal/app.js | 4 ++-- mccs-it/thermal/modules/Thermal.js | 3 +-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/mccs-it/thermal/app.js b/mccs-it/thermal/app.js index 56b7b5e..1dc1151 100644 --- a/mccs-it/thermal/app.js +++ b/mccs-it/thermal/app.js @@ -18,10 +18,10 @@ app.post('/print-credentials', async (req, res) => { return res.status(400).json({ message: 'Username and Student ID are required.' }); } // Generate the information string - const infoString = Thermal.generateInfo.credentials(username, studentId); + const infoArray = Thermal.generateInfo.credentials(username, studentId); // Generate the PDF, saved to disk - Thermal.generatePdf(infoString).catch(e => { + Thermal.generatePdf(infoArray).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 1a2ff11..d43e5e6 100644 --- a/mccs-it/thermal/modules/Thermal.js +++ b/mccs-it/thermal/modules/Thermal.js @@ -22,7 +22,7 @@ module.exports = { generateInfo: { credentials(username, studentId) { // Create the output text - const infoArray = [ + return [ { font: 'Courier-Bold', text: `Username: ${username}` }, { font: 'public/Outfit-Regular.ttf', text: '' }, { font: 'public/Outfit-Regular.ttf', text: 'Email:' }, @@ -32,7 +32,6 @@ module.exports = { { font: 'public/Outfit-Regular.ttf', text: '' }, { font: 'public/Outfit-Regular.ttf', text: 'Note: the MyKV Portal uses your username to sign in, not email.' }, ] - return infoArray.join('\n'); }, maineCC() { // Create the output text