Files
aigen/server/api/prompt-sequences/[id].patch.ts
T
TowstyandCursor 45e97cc1c3 Add Prompt Builder sequence section order.
Copied scene text and the scene editor follow a persisted sectionOrder, with legacy saves keeping the default style/settings/set/characters/prompt order.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-10-04 07:07:43 -05:00

25 lines
697 B
TypeScript

import { listPromptSequences, updatePromptSequence } from '~/server/utils/promptSequences'
export default defineEventHandler(async (event) => {
const { owner } = assertLibraryOwner(event)
const id = String(getRouterParam(event, 'id') || '')
const body = await readBody<{
name?: string
sectionOrder?: unknown
characters?: unknown
sets?: unknown
scenes?: unknown
}>(event).catch(() => ({}))
const sequence = await updatePromptSequence(owner, id, {
name: body?.name,
sectionOrder: body?.sectionOrder,
characters: body?.characters,
sets: body?.sets,
scenes: body?.scenes
})
return {
sequence,
sequences: listPromptSequences(owner)
}
})