From e82c232b443131f9f9b762cdc28d2a181c8fc06a Mon Sep 17 00:00:00 2001 From: Test User Date: Thu, 23 Apr 2026 23:11:45 +0000 Subject: [PATCH] fix(GRO-876): remove dead issueRefund function from InvoiceDetailModal The inline async onClick handler already calls the refund API directly. The separate issueRefund function was defined but never called, causing @typescript-eslint/no-unused-vars CI failure on PR #351. Co-Authored-By: Paperclip --- apps/web/src/pages/Invoices.tsx | 29 ----------------------------- 1 file changed, 29 deletions(-) diff --git a/apps/web/src/pages/Invoices.tsx b/apps/web/src/pages/Invoices.tsx index a3094d9..a3164b6 100644 --- a/apps/web/src/pages/Invoices.tsx +++ b/apps/web/src/pages/Invoices.tsx @@ -291,35 +291,6 @@ const [showRefundDialog, setShowRefundDialog] = useState(false); } } - async function issueRefund() { - const amountCents = refundType === "partial" - ? Math.round(parseFloat(refundAmount) * 100) - : undefined; - if (refundType === "partial" && (!amountCents || amountCents <= 0)) { - setError("Enter a valid refund amount"); - return; - } - setSaving(true); - setError(null); - try { - const res = await fetch(`/api/invoices/${invoice.id}/refund`, { - method: "POST", - headers: { "Content-Type": "application/json" }, - body: JSON.stringify(amountCents ? { amountCents } : {}), - }); - if (!res.ok) { - const err = (await res.json()) as { error?: string }; - throw new Error(err.error ?? `HTTP ${res.status}`); - } - setShowRefundDialog(false); - onUpdated(); - } catch (e: unknown) { - setError(e instanceof Error ? e.message : "Failed to issue refund"); - } finally { - setSaving(false); - } - } - if (loading) return

Loading…

; const tipCentsCalc = Math.round(parseFloat(tipStr) * 100) || 0;