CI / build + unit + e2e (pull_request) Successful in 3m47s
- ADMIN button in the mission-control header opens a table picker + row grid with add/edit/delete (components/admin-panel.tsx), deliberately unauthenticated by explicit request
- /api/admin/tables and /api/admin/tables/{name}/rows driven off a name→table registry built from lib/db/schema.ts (lib/db/admin.ts) — no per-table code; 404 unknown table, 400 malformed payload, 409 constraint violation
- OpenAPI spec updated for all four admin operations + Admin* schemas
- unit: lib/db/admin.test.ts (registry, CRUD round-trips, composite PKs, error mapping); e2e: read-only admin.spec.ts
9 lines
319 B
TypeScript
9 lines
319 B
TypeScript
import { getGameDb } from '@/lib/db/client'
|
|
import { listAdminTables } from '@/lib/db/admin'
|
|
|
|
// #38 — admin DB CRUD, no auth by explicit request (ponytail: add auth before exposing beyond the dev host).
|
|
export async function GET() {
|
|
const db = await getGameDb()
|
|
return Response.json(await listAdminTables(db))
|
|
}
|