fix: Speichern-Button funktioniert nicht + mehrere Bugfixes#23
Merged
Conversation
Bug 1: parseInt() zerstörte Dezimalwerte bei Menge (kg, Liter, g, ml)
- parseInt("0.5") = 0, dann 0 || 1 = 1 → falsche Menge gespeichert
- Gefixt: parseFloat() für quantity und minStock
Bug 2: Mengenfeld hatte min="1" fest, blockierte Dezimalwerte
- Gefixt: dynamischer min/step je Einheit (kg=0.1, Liter=0.25, etc.)
Bug 3: Kein Error-Handling in handleSubmit
- Bei DB-Fehlern blieb der Button auf "Speichert..." hängen
- Gefixt: try/catch/finally mit Fehlermeldung und setSaving(false)
Bug 4: ConsumeModal startete immer bei 1, auch wenn max < 1
- z.B. 0.5 kg Nüsse → Startwert war 1 (über dem Vorrat)
- Gefixt: Startwert = Math.min(step, max)
https://claude.ai/code/session_0169CbohMRqddD1LjPg8FmXf
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Bug 1: parseInt() zerstörte Dezimalwerte bei Menge (kg, Liter, g, ml)
Bug 2: Mengenfeld hatte min="1" fest, blockierte Dezimalwerte
Bug 3: Kein Error-Handling in handleSubmit
Bug 4: ConsumeModal startete immer bei 1, auch wenn max < 1
https://claude.ai/code/session_0169CbohMRqddD1LjPg8FmXf