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) })