getting lost files back and making some changes p1

This commit is contained in:
2026-01-14 20:15:07 +01:00
parent 26d140f910
commit bcc5164abb
30609 changed files with 18693 additions and 77811 deletions
+21
View File
@@ -0,0 +1,21 @@
// make api route to get all sellables
import { NextResponse } from "next/server";
import { auth } from "~/server/auth";
import { db } from "~/server/db";
export async function GET() {
const session = await auth();
if (!session) {
return NextResponse.json({ error: "Unauthorized" }, { status: 401 });
}
const sellables = await db.sellable.findMany({
include: {
shop: { select: { label: true } },
item: { select: { stock: true } },
},
});
return NextResponse.json(sellables);
}