Add clickable keep-prompt snippets for video and image.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Towsty
2026-08-31 20:39:08 -05:00
co-authored by Cursor
parent 529598cef2
commit a3380870ad
7 changed files with 407 additions and 12 deletions
+11
View File
@@ -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)
})