From cf20f851481087f18746086f9106f43d5c3a17a2 Mon Sep 17 00:00:00 2001 From: Maxime Princelle <maxime@princelle.org> Date: Fri, 17 Dec 2021 14:16:17 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20add=20verifications=20before=20a?= =?UTF-8?q?dding=20product?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/add_product.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/add_product.tsx b/src/pages/add_product.tsx index c0d9d3d..f9015cf 100644 --- a/src/pages/add_product.tsx +++ b/src/pages/add_product.tsx @@ -20,7 +20,7 @@ const AddProduct = () => { }, []); function createItem() { - if (category_id !== "n/a") { + if (category_id !== "n/a" && name != "" && price > 0 && priceAdherant > 0 && stock > 0) { console.log("Creating item: " + name + " " + price + " " + priceAdherant + " " + stock + " " + category_id); addItem(name, price, priceAdherant, stock, category_id).then((data) => { console.log(data); -- GitLab