fix(GRO-628): implement frontend error handling and code quality fixes #313

Merged
groombook-engineer[bot] merged 7 commits from feature/gro-628-frontend-error-handling into dev 2026-04-17 07:12:27 +00:00
Showing only changes of commit f301b1a5a0 - Show all commits
+9
View File
@@ -211,6 +211,15 @@ function InvoiceDetailModal({
setSaving(true);
setError(null);
const tipCents = Math.round(parseFloat(tipStr) * 100) || 0;
// Real-time validation: prevent submit if tip splits don't sum to 100%
if (showSplits && tipCents > 0 && tipSplits.length > 0) {
const totalPct = tipSplits.reduce((s, r) => s + r.pct, 0);
if (Math.abs(totalPct - 100) >= 0.01) {
setError("Tip split percentages must sum to 100%");
setSaving(false);
return;
}
}
try {
const res = await fetch(`/api/invoices/${invoice.id}`, {
method: "PATCH",