mirror of
https://github.com/jakejarvis/sofa.git
synced 2026-08-29 03:55:38 -04:00
Replace API route handlers with server actions across the app
- Delete 10 API routes (stats, system-health, update-check, jobs/trigger, backup/restore, person, titles import/resolve, registration/status) and move logic into server actions in lib/actions/settings.ts and lib/actions/watchlist.ts - Refactor SystemHealthCards to accept initialData prop and hydrate Jotai atoms via useHydrateAtoms; replace useSystemHealth SWR hook with a lightweight useSystemHealthRefresh that calls getSystemHealthAction - Convert BackupRestoreSection to use restoreBackupAction + useTransition instead of a raw fetch call - Split SystemStatusCard, BackgroundJobsCard, and StorageCard into standalone components reading from systemHealthDataAtom - Make SetupPage async with connection() to opt into dynamic rendering
This commit is contained in:
@@ -1,8 +1,10 @@
|
||||
import { redirect } from "next/navigation";
|
||||
import { connection } from "next/server";
|
||||
import { isTmdbConfigured } from "@/lib/config";
|
||||
import { SetupForm } from "./_components/setup-form";
|
||||
|
||||
export default function SetupPage() {
|
||||
export default async function SetupPage() {
|
||||
await connection();
|
||||
if (isTmdbConfigured()) redirect("/");
|
||||
return <SetupForm />;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user