From 911c6f749643ec8a6b8cd5dbb8ebb2b2a10cd0fc Mon Sep 17 00:00:00 2001 From: Dave Date: Thu, 27 Aug 2026 00:55:00 +0200 Subject: [PATCH] chore(approvals): drop dead handleApprovePartial Task 2 collapsed the list's per-row "Approve partial" button into the new "Approve & send" button, which routes through review-approve on the server. The list no longer calls the legacy partial-approve endpoint, but handleApprovePartial was left in the page file because the plan's Step 3 only covered handleApprove replacement. Remove it. The /api/v1/quotes/[id]/partial-approve endpoint itself is unchanged (it's still used by other parts of the app). Co-Authored-By: Claude --- src/app/(app)/quotes/approvals/page.tsx | 36 ------------------------- 1 file changed, 36 deletions(-) diff --git a/src/app/(app)/quotes/approvals/page.tsx b/src/app/(app)/quotes/approvals/page.tsx index b120a24..f2866bd 100644 --- a/src/app/(app)/quotes/approvals/page.tsx +++ b/src/app/(app)/quotes/approvals/page.tsx @@ -264,42 +264,6 @@ export default function ApprovalsPage() { void ensureOutboundAttachments(quoteId); }; - /** - * Approve a partial quote. Marks priced items as - * `approved_in_batch`, flips status to `partial_approved`, then - * the rep still needs to send the email from the quote detail - * page (the existing approve modal flow). We do NOT send from - * here because the partial flow is more complex (operator - * needs to compose subject/body for the email) and reusing the - * existing modal keeps the partial path consistent with the - * full one. - * - * Surface: toast tells the rep "open the quote to send the - * partial" and the rep clicks the quote to continue. - */ - const handleApprovePartial = async (id: string) => { - setActionLoading(id); - try { - const res = await fetch( - `/api/v1/quotes/${id}/partial-approve`, - { method: "POST" } - ); - if (!res.ok) { - const err = (await res.json().catch(() => ({}))) as { error?: string }; - throw new Error(err.error || `Partial approve failed (HTTP ${res.status})`); - } - const data = (await res.json()) as { itemsMarked?: number }; - toast.success( - `${data.itemsMarked ?? 0} items marked approved — open the quote to send the email.` - ); - fetchApprovals(); - } catch (err: unknown) { - toast.error(err instanceof Error ? err.message : "Failed to partial-approve"); - } finally { - setActionLoading(""); - } - }; - const handleReject = async () => { if (!rejectId) return; setActionLoading(rejectId);