feat: contacts and voucher assignment
This commit is contained in:
1 parent
c86ec8bd36
commit
f2b1d0293a
8 files changed
+154
-4
No files matched your search
@@ -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);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user