Skip to content

Commit 8345575

Browse files
committed
Set product price and stock to zero in product creation endpoint
1 parent 980204f commit 8345575

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

server/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -240,9 +240,9 @@ app.post('/api/products', csrfProtection, (req, res) => {
240240
const newProduct = {
241241
id: Date.now(),
242242
name,
243-
price: parseFloat(price),
244243
category,
245-
stock: parseInt(stock) || 0,
244+
price: 0, // always zero
245+
stock: 0, // always zero
246246
description: description || ''
247247
};
248248

0 commit comments

Comments
 (0)