From 693515aab5af8b921be2b9021e72c2c21bab8ace Mon Sep 17 00:00:00 2001 From: Pepe Ziberi Date: Thu, 21 May 2026 15:26:14 +0200 Subject: [PATCH] fix(tenant-symbols): POST /api/tenant/symbols iconAsset-Legacy-Pfad auf Raw-SQL umgestellt --- src/app/api/tenant/symbols/route.ts | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/app/api/tenant/symbols/route.ts b/src/app/api/tenant/symbols/route.ts index 0f7e8f6..f5034e1 100644 --- a/src/app/api/tenant/symbols/route.ts +++ b/src/app/api/tenant/symbols/route.ts @@ -212,13 +212,14 @@ export async function POST(req: NextRequest) { return NextResponse.json({ error: 'iconId oder templateId erforderlich' }, { status: 400 }) } - const icon = await prisma.iconAsset.findUnique({ - where: { id: iconId }, - include: { category: true }, - }) - if (!icon) { + const icons = await prisma.$queryRawUnsafe( + `SELECT * FROM icon_assets WHERE id = $1 LIMIT 1`, + iconId + ) as any[] + if (!icons || icons.length === 0) { return NextResponse.json({ error: 'Icon nicht gefunden' }, { status: 404 }) } + const icon = icons[0] const result = await prisma.$queryRawUnsafe( `INSERT INTO tenant_symbols (id, "tenantId", "iconId", "customName", name, "svgPath", "categoryId", "sortOrder", "isUploaded", "createdAt", "updatedAt")