added add-product page/form

This commit is contained in:
2026-05-27 18:32:31 +02:00
parent 4b1443f197
commit 96488a3137
4 changed files with 313 additions and 2 deletions
@@ -20,12 +20,19 @@ export const newProduct = async (
expiry_date,
bottling_date,
) => {
let newPrice;
if (price == "") {
newPrice = null;
} else {
newPrice = price;
}
const [result] = await pool.query(
"INSERT INTO products (name, description, price, amount, storage_location, expiry_date, bottling_date) VALUES (?, ?, ?, ?, UUID_TO_BIN(?), ?, ?)",
[
name,
description,
price,
newPrice,
amount,
storage_location,
expiry_date,