feat: prisma schema, groups API, deploy workflow
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
import { requireAuth } from '~/server/utils/auth'
|
||||
import { canvases } from '~/server/utils/db'
|
||||
|
||||
export default defineEventHandler(async (event) => {
|
||||
requireAuth(event)
|
||||
const id = getRouterParam(event, 'id')
|
||||
const body = await readBody(event)
|
||||
|
||||
const existing = canvases.get(id || '')
|
||||
if (!existing) {
|
||||
throw createError({ statusCode: 404, message: 'Canvas not found' })
|
||||
}
|
||||
|
||||
const updated = {
|
||||
...existing,
|
||||
...body,
|
||||
id: existing.id,
|
||||
updatedAt: new Date().toISOString()
|
||||
}
|
||||
|
||||
canvases.set(id || '', updated)
|
||||
|
||||
return { canvas: updated }
|
||||
})
|
||||
Reference in New Issue
Block a user