From 8345575bb3ca32b6b40c0d04795f342d406e0d62 Mon Sep 17 00:00:00 2001 From: Jaydeep Dave Date: Mon, 27 Oct 2025 18:50:21 +0530 Subject: [PATCH] Set product price and stock to zero in product creation endpoint --- server/index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server/index.js b/server/index.js index 75566ee..5a385cc 100644 --- a/server/index.js +++ b/server/index.js @@ -240,9 +240,9 @@ app.post('/api/products', csrfProtection, (req, res) => { const newProduct = { id: Date.now(), name, - price: parseFloat(price), category, - stock: parseInt(stock) || 0, + price: 0, // always zero + stock: 0, // always zero description: description || '' };