refactor(ux): consolidate BMAD skills, update design system, and clean up Prisma generated client

This commit is contained in:
Sepehr Ramezani
2026-04-19 19:21:27 +02:00
parent 5296c4da2c
commit 25529a24b8
2476 changed files with 127934 additions and 101962 deletions

View File

@@ -0,0 +1,33 @@
import { NextResponse } from 'next/server'
import { prisma } from '@/lib/prisma'
import { auth } from '@/auth'
import { revalidatePath } from 'next/cache'
export async function POST(req: Request) {
try {
const session = await auth()
if (!session?.user?.id) return NextResponse.json({ error: 'Unauthorized' }, { status: 401 })
const body = await req.json()
const { id, name, data } = body
if (id) {
const canvas = await prisma.canvas.update({
where: { id, userId: session.user.id },
data: { name, data }
})
return NextResponse.json({ success: true, canvas })
} else {
const canvas = await prisma.canvas.create({
data: {
name,
data,
userId: session.user.id
}
})
return NextResponse.json({ success: true, canvas })
}
} catch (error) {
return NextResponse.json({ error: 'Internal Server Error' }, { status: 500 })
}
}