From 8e9c679c2bbd2753de486d0001b2c03a11924bb0 Mon Sep 17 00:00:00 2001 From: ChrisChrome Date: Tue, 11 Aug 2026 23:06:13 -0600 Subject: [PATCH] Add some logging --- messageHandlers/update_prod.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/messageHandlers/update_prod.js b/messageHandlers/update_prod.js index 489e715..07b6656 100644 --- a/messageHandlers/update_prod.js +++ b/messageHandlers/update_prod.js @@ -97,6 +97,7 @@ const execute = async (message) => { cancel(message.author); return; } + const productId = global.productUpdateData[message.author.id].id; const file = fs.createWriteStream(`./productFiles/${crypto.randomBytes(8).toString('hex')}`); download(attachment.url, file.path, async (err) => { if (err) { @@ -105,7 +106,7 @@ const execute = async (message) => { return; } const fileType = attachment.name.split('.').pop(); - await pool.query('UPDATE products SET file = ?, fileType = ? WHERE id = ?', [file.path.split('/').pop(), fileType, global.productUpdateData[message.author.id].id]); + await pool.query('UPDATE products SET file = ?, fileType = ? WHERE id = ?', [file.path.split('/').pop(), fileType, productId]); message.channel.send('File updated successfully!'); }); } else {