From 005f28bd5ab3d803837e3361f049481fbdafcde1 Mon Sep 17 00:00:00 2001 From: ChrisChrome Date: Thu, 16 Jan 2025 21:50:56 -0700 Subject: [PATCH] Fix issue with payment processing --- routes/payments.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/routes/payments.js b/routes/payments.js index a950a5c..9178aa8 100644 --- a/routes/payments.js +++ b/routes/payments.js @@ -25,7 +25,7 @@ router.post("/external/hub/order/complete", async (req, res) => { // Insert purchase into database await pool.query('INSERT INTO purchases (robloxId, productId, hubId) VALUES (?, ?, ?)', [robloxID, product.id, hub.id]); - if (product.stock !== -1 && product.stock !== 0) { + if (product.stock != -1 && product.stock != 0) { await pool.query('UPDATE products SET stock = stock - 1 WHERE id = ?', [product.id]); } res.status(200).json({ status: "200", message: 'Purchased product' }); @@ -104,7 +104,7 @@ router.post("/external/hub/gift/complete", async (req, res) => { // Insert purchase into database await pool.query('INSERT INTO purchases (robloxId, productId, hubId) VALUES (?, ?, ?)', [recipientID, product.id, hub.id]); - if (product.stock !== -1 && product.stock !== 0) { + if (product.stock != -1 && product.stock != 0) { await pool.query('UPDATE products SET stock = stock - 1 WHERE id = ?', [product.id]); } res.status(200).json({ status: "200", message: 'Gifted product to user' });