pr_01m47d24b0e6n91zwymwxg0vpx/apps/sudo/app/routes/legacy-accounts.tsx
Pick any line to see why it is the way it is: the commit, the pull request and issue it came from, and what the agent was thinking.
| Billing on Stripe's pages, month-end charges, warnings; sudo by workspace | 1 | import { data, redirect } from "react-router"; |
| 2 | ||
| 3 | import type { Route } from "./+types/legacy-accounts"; | |
| 4 | import { requireStaff } from "~/lib/staff"; | |
| 5 | import { legacyAccountPath } from "~/lib/workspaces"; | |
| 6 | ||
| 7 | /** | |
| 8 | * Old links: `/accounts` was the list, `/accounts/ws_<slug>` a workspace's | |
| 9 | * own account and `/accounts/ent_…` an enterprise. | |
| 10 | */ | |
| 11 | export async function loader({ request, params, context }: Route.LoaderArgs) { | |
| 12 | requireStaff(context); | |
| 13 | const id = (params["*"] ?? "").replace(/\/+$/, ""); | |
| A menu shaped by how g1t works, Soon pages for every promise, and sudo for sales | 14 | if (!id) return redirect(`/workspaces${new URL(request.url).search}`, 301); |
| Billing on Stripe's pages, month-end charges, warnings; sudo by workspace | 15 | const path = legacyAccountPath(id); |
| 16 | if (!path) throw data("That is not a workspace or an enterprise.", { status: 404 }); | |
| 17 | return redirect(path, 301); | |
| 18 | } | |
| 19 | ||
| 20 | export default function LegacyAccounts() { | |
| 21 | return null; | |
| 22 | } |