Add clickable keep-prompt snippets for video and image.
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -0,0 +1,11 @@
|
||||
import { libraryOwnerKey, publicLibrary, setKeepPrompts } from '~/server/utils/library'
|
||||
import { parseKeepPromptKind } from '~/utils/keepPrompts'
|
||||
|
||||
export default defineEventHandler(async (event) => {
|
||||
const body = await readBody<{ kind?: unknown; items?: unknown }>(event)
|
||||
const kind = parseKeepPromptKind(body?.kind)
|
||||
if (!kind) throw createError({ statusCode: 400, statusMessage: 'Kind must be video or image' })
|
||||
const owner = libraryOwnerKey(event)
|
||||
await setKeepPrompts(owner, kind, body?.items)
|
||||
return publicLibrary(event)
|
||||
})
|
||||
Reference in New Issue
Block a user