rubgram complete

This commit is contained in:
Dreamgineer
2025-12-11 08:37:17 +07:00 Unverified
parent 9b03a9cc8b
commit d8651187ab
42 changed files with 910 additions and 207 deletions
+28
View File
@@ -0,0 +1,28 @@
import { eq } from "drizzle-orm";
import { notFound } from "next/navigation";
import { db } from "@/lib/db";
import { endgameSlips } from "@/lib/db/schema";
export async function GET(
_: Request,
{ params }: { params: Promise<{ id: string }> },
) {
const { id } = await params;
const [sub] = await db
.select({ slip: endgameSlips.slip })
.from(endgameSlips)
.where(eq(endgameSlips.id, id))
.limit(1);
if (!sub) notFound();
if (!sub.slip) notFound();
console.log(sub.slip.length);
return new Response(new Uint8Array(sub.slip), {
headers: {
"Content-Type": "image/jpeg",
},
});
}