pr_01m47d15m3e54sn21z27rpy5n9/apps/sudo/app/routes/legacy-accounts.tsx

22 lines794 bytesCodeBlame

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 workspace1import { data, redirect } from "react-router";
2
3import type { Route } from "./+types/legacy-accounts";
4import { requireStaff } from "~/lib/staff";
5import { 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 */
11export 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 sales14 if (!id) return redirect(`/workspaces${new URL(request.url).search}`, 301);
Billing on Stripe's pages, month-end charges, warnings; sudo by workspace15 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
20export default function LegacyAccounts() {
21 return null;
22}