feat: add extensive test suite

This commit is contained in:
2026-08-30 11:33:53 +07:00 Unverified
parent 061cce00dc
commit 8359c7272e
131 changed files with 8717 additions and 2200 deletions
+4 -16
View File
@@ -2,25 +2,13 @@ import { eq } from "drizzle-orm";
import { notFound } from "next/navigation";
import { db } from "@/lib/db";
import { endgameSlips } from "@/lib/db/schema";
import { createSlipHandler } from "@/lib/server-handlers";
export async function GET(
_: Request,
{ params }: { params: Promise<{ id: string }> },
) {
const { id } = await params;
export const GET = createSlipHandler(async (id) => {
const [sub] = await db
.select({ slip: endgameSlips.slip })
.from(endgameSlips)
.where(eq(endgameSlips.id, id))
.limit(1);
if (!sub) notFound();
if (!sub.slip) notFound();
return new Response(new Uint8Array(sub.slip), {
headers: {
"Content-Type": "image/jpeg",
},
});
}
return sub?.slip ? new Uint8Array(sub.slip) : null;
}, notFound);