import { eq } from 'drizzle-orm' import { z } from 'zod' const schema = z.object({ title: z.string().min(1), description: z.string(), worldSetting: z.string(), storyOutline: z.string(), userName: z.string(), requirements: requirementsSchema, settings: settingsSchema, memory: memorySchema }) export default defineEventHandler(async (event) => { const id = param(event) getProject(id) const body = await readPatch(event, schema) useDb().update(tables.projects).set(body).where(eq(tables.projects.id, id)).run() return getProject(id) })