14 lines
373 B
TypeScript
Executable File
14 lines
373 B
TypeScript
Executable File
import { sql } from "drizzle-orm";
|
|
import { redirect } from "next/navigation";
|
|
import { db } from "@/lib/db";
|
|
import { endgameArchive } from "@/lib/db/schema";
|
|
|
|
export async function GET() {
|
|
const [{ max }] = await db
|
|
.select({
|
|
max: sql<number>`max(${endgameArchive.round})`,
|
|
})
|
|
.from(endgameArchive);
|
|
redirect(`/rubgram/admin/slip/${max || "1"}`);
|
|
}
|