From d61a2a1ffeb8412bab66da8856ac05dca8ae9bb8 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:17:39 +0000 Subject: [PATCH 1/2] Changes Co-authored-by: renee-png <262607627+renee-png@users.noreply.github.com> --- src/routes/cases.index.tsx | 41 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/src/routes/cases.index.tsx b/src/routes/cases.index.tsx index 83b2713..69aefe8 100644 --- a/src/routes/cases.index.tsx +++ b/src/routes/cases.index.tsx @@ -43,6 +43,7 @@ function CasesList() { const [selected, setSelected] = useState>(new Set()); const [assignAttorney, setAssignAttorney] = useState(""); const [assignClient, setAssignClient] = useState(""); + const [assignStatus, setAssignStatus] = useState(""); const [busy, setBusy] = useState(false); const [page, setPage] = useState(1); const PAGE_SIZE = 150; @@ -246,6 +247,30 @@ function CasesList() { load(); }; + const bulkAssignStatus = async () => { + if (selected.size === 0 || !assignStatus) return; + setBusy(true); + const ids = Array.from(selected); + const isClosed = assignStatus.startsWith("closed"); + const { data, error } = await supabase + .from("cases") + .update({ + status: assignStatus, + closed_at: isClosed ? new Date().toISOString().slice(0, 10) : null, + }) + .in("id", ids) + .select("id"); + setBusy(false); + if (error) { toast.error(error.message); return; } + const n = data?.length ?? 0; + if (n === 0) { toast.error("No cases were updated. You may not have permission."); return; } + if (n < ids.length) toast.warning(`${n} of ${ids.length} case(s) updated (others skipped)`); + else toast.success(`${n} case(s) status updated`); + setSelected(new Set()); + setAssignStatus(""); + load(); + }; + const userOptions = users.map((u) => ({ value: u.id, label: u.full_name || u.email || u.id, @@ -352,6 +377,22 @@ function CasesList() { +
+ Status: + +
)} From f5b721c2ab939ee2d3e03fec35371ff532bba8bf 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:17:47 +0000 Subject: [PATCH 2/2] Changes Co-authored-by: renee-png <262607627+renee-png@users.noreply.github.com> --- src/routes/cases.index.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/routes/cases.index.tsx b/src/routes/cases.index.tsx index 69aefe8..0d7d752 100644 --- a/src/routes/cases.index.tsx +++ b/src/routes/cases.index.tsx @@ -255,7 +255,7 @@ function CasesList() { const { data, error } = await supabase .from("cases") .update({ - status: assignStatus, + status: assignStatus as "active" | "closed" | "closed_lost" | "closed_won" | "intake" | "on_hold", closed_at: isClosed ? new Date().toISOString().slice(0, 10) : null, }) .in("id", ids)