This commit is contained in:
Philippe Torrel
2026-10-12 09:22:39 +02:00
parent ff82f5a054
commit 87773ffa50
4 changed files with 15 additions and 1 deletions
BIN
View File
Binary file not shown.
@@ -0,0 +1,12 @@
{
"name": "product-manager-final",
"version": "1.0.0",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "product-manager-final",
"version": "1.0.0"
}
}
}
@@ -32,6 +32,8 @@ const ProductModel = () => {
const add = (product) => {
const { name, price } = product;
// TODO: Validierung des Produkts
products.push({
_id: id(),
position: products.length + 1,
@@ -12,7 +12,7 @@ try {
console.log(products);
fs.writeFileSync('../data/products2.json', JSON.stringify(products, null, 2));
fs.writeFileSync('../data/products.json', JSON.stringify(products, null, 2));
} catch (error) {
console.log(error);
}