Skip to content
Snippets Groups Projects
Commit cf20f851 authored by Princelle Maxime's avatar Princelle Maxime :gay_pride_flag:
Browse files

:bug: add verifications before adding product

parent d4b945f7
Branches
1 merge request!7🔀 V1
......@@ -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);
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment