This commit is contained in:
Christopher Cookman 2025-09-15 07:26:02 -06:00
parent 3f9554e33e
commit 3bb2aa65cd

View file

@ -133,6 +133,8 @@ const execute = async (message) => {
message.channel.send('Category updated!'); message.channel.send('Category updated!');
break; break;
case "delete": // Delete case "delete": // Delete
const product = global.productUpdateData[message.author.id].id;
console.log(product);
if (message.content.toLowerCase() === 'cancel') { if (message.content.toLowerCase() === 'cancel') {
cancel(message.author); cancel(message.author);
return; return;
@ -141,14 +143,13 @@ const execute = async (message) => {
message.channel.send('You must type `confirm` to delete the product, or `cancel` to exit.'); message.channel.send('You must type `confirm` to delete the product, or `cancel` to exit.');
return; return;
} }
console.log(global.productUpdateData[message.author.id])
// Proceed with deletion // Proceed with deletion
message.channel.send('Deletion Confirmed. Starting deletion process...').then(async msg => { message.channel.send('Deletion Confirmed. Starting deletion process...').then(async msg => {
let curMsg = msg.content; let curMsg = msg.content;
// Delete fileAuth // Delete fileAuth
curMsg = curMsg + '\nDeleting file authorizations...' curMsg = curMsg + '\nDeleting file authorizations...'
await msg.edit(curMsg); await msg.edit(curMsg);
await pool.query('DELETE FROM fileAuth WHERE product = ?', [global.productUpdateData[message.author.id].id]); await pool.query('DELETE FROM fileAuth WHERE product = ?', [product]);
// Delete file // Delete file
curMsg = curMsg + '\nDeleting product file...' curMsg = curMsg + '\nDeleting product file...'
await msg.edit(curMsg); await msg.edit(curMsg);