diff --git a/src/templates/index.html b/src/templates/index.html index d1ffb2c..2eb5d19 100644 --- a/src/templates/index.html +++ b/src/templates/index.html @@ -111,24 +111,24 @@ document.getElementById('submit-button').disabled = !(food && weight); } - function addProduct() { - const foodInput = document.getElementById('my_combobox'); - const weightInput = document.getElementById('weight'); - const portionsInput = document.getElementById('portions'); - const food = foodInput.value; - let weight = parseFloat(weightInput.value); - const portions = Math.max(parseInt(portionsInput.value, 10), 1); // Stellt sicher, dass mindestens 1 Portion angegeben wird +// function addProduct() { +// const foodInput = document.getElementById('my_combobox'); +// const weightInput = document.getElementById('weight'); +// const portionsInput = document.getElementById('portions'); +// const food = foodInput.value; +// let weight = parseFloat(weightInput.value); +// const portions = Math.max(parseInt(portionsInput.value, 10), 1); // Stellt sicher, dass mindestens 1 Portion angegeben wird - // Teilen des Gewichts durch die Anzahl der Portionen und Aufrunden - weight = Math.ceil(weight / portions); +// // Teilen des Gewichts durch die Anzahl der Portionen und Aufrunden +// weight = Math.ceil(weight / portions); - fetch(`/add_lm?food=${encodeURIComponent(food)}&weight=${encodeURIComponent(weight)}`) - .then(response => response.json()) - .then(data => { - // Fügen Sie die verarbeitete Logik hier hinzu, wie zuvor - }) - .catch(error => console.error('Fehler:', error)); -} +// fetch(`/add_lm?food=${encodeURIComponent(food)}&weight=${encodeURIComponent(weight)}`) +// .then(response => response.json()) +// .then(data => { +// // Fügen Sie die verarbeitete Logik hier hinzu, wie zuvor +// }) +// .catch(error => console.error('Fehler:', error)); +// } function addProduct() { const foodInput = document.getElementById('my_combobox');