@@ -13,4 +16,3 @@ function App() {
)
}
-export default App
diff --git a/frontend/src/components/ProductList.tsx b/frontend/src/components/ProductList.tsx
index 6985ea2..32fbf85 100644
--- a/frontend/src/components/ProductList.tsx
+++ b/frontend/src/components/ProductList.tsx
@@ -18,13 +18,28 @@ export default function ProductList() {
});
}, []);
+ function deleteThisItem(id:string){
+ axios.delete("/api/products/" + id)
+ .then(() => {axios.get
('api/products')
+ .then(response => {
+ setProducts(response.data);
+ })
+ .catch(error => {
+ console.error("Es gab einen Fehler beim Abrufen der Daten!", error);
+ });})
+
+ }
+
return (
Einkaufsliste
{products.map(product => (
-
+
{product.name} - Menge: {product.amount}
+
+
+
))}
diff --git a/frontend/src/models/AppDelete.tsx b/frontend/src/models/AppDelete.tsx
new file mode 100644
index 0000000..e69de29