From 75b847a483fa8a28a86c64388d02adad1ccbc754 Mon Sep 17 00:00:00 2001 From: "gpt-engineer-app[bot]" <159125892+gpt-engineer-app[bot]@users.noreply.github.com> Date: Sun, 19 Apr 2026 18:59:35 +0000 Subject: [PATCH] Changes Co-authored-by: renee-png <262607627+renee-png@users.noreply.github.com> --- src/routes/invoices.index.tsx | 28 ++-------------------------- 1 file changed, 2 insertions(+), 26 deletions(-) diff --git a/src/routes/invoices.index.tsx b/src/routes/invoices.index.tsx index 30e9a12..238f03c 100644 --- a/src/routes/invoices.index.tsx +++ b/src/routes/invoices.index.tsx @@ -198,19 +198,7 @@ function InvoicesIndex() { toast.success(`Marked ${idArr.length} item(s) as unbilled`); } // Refetch invoices to refresh placeholder set + unbilled lists - const { data: inv } = await supabase - .from("invoices") - .select("*, client:clients(id, name), case:cases(id, case_number, title)") - .order("created_at", { ascending: false }); - setInvoices(inv ?? []); - setPlaceholderIds(new Set( - (inv ?? []) - .filter((i: any) => - typeof i.invoice_number === "string" && - (i.invoice_number.startsWith("MARKED-INVOICED-") || i.invoice_number.startsWith("IMPORT-PREBILLED-")) - ) - .map((i: any) => i.id), - )); + await fetchInvoices(); await loadUnbilled(); if (table === "time_entries") setSelectedTime(new Set()); else setSelectedExp(new Set()); } catch (err: any) { @@ -221,19 +209,7 @@ function InvoicesIndex() { }; const refreshInvoices = async () => { - const { data } = await supabase - .from("invoices") - .select("*, client:clients(id, name), case:cases(id, case_number, title)") - .order("created_at", { ascending: false }); - setInvoices(data ?? []); - setPlaceholderIds(new Set( - (data ?? []) - .filter((i: any) => - typeof i.invoice_number === "string" && - (i.invoice_number.startsWith("MARKED-INVOICED-") || i.invoice_number.startsWith("IMPORT-PREBILLED-")) - ) - .map((i: any) => i.id), - )); + await fetchInvoices(); }; const bulkInvoiceAction = async (action: "delete" | "sent" | "void") => {