fix(tenant-symbols): POST /api/tenant/symbols iconAsset-Legacy-Pfad auf Raw-SQL umgestellt
Some checks failed
Build and Push Docker Image / build-and-push (push) Has been cancelled
Some checks failed
Build and Push Docker Image / build-and-push (push) Has been cancelled
This commit is contained in:
@@ -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")
|
||||
|
||||
Reference in New Issue
Block a user