feat: contacts and voucher assignment

This commit is contained in:
opencode committed 2026-10-18 10:33:05 +02:00
1 parent c86ec8bd36
commit f2b1d0293a
8 files changed
+154 -4

No files matched your search

+1 -1
View File
@@ -6,7 +6,7 @@ export async function GET(_req: NextRequest, { params }: { params: Promise<{ id:
const numId = Number(id);
if (!Number.isInteger(numId)) return NextResponse.json({ error: "not found" }, { status: 404 });
const db = getDb();
const v = await db.voucher.findUnique({ where: { id: numId } });
const v = await db.voucher.findUnique({ where: { id: numId }, include: { contacts: { include: { contact: true } } } });
if (!v) return NextResponse.json({ error: "not found" }, { status: 404 });
return NextResponse.json(v);
}