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>
25 lines
697 B
TypeScript
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)
|
|
}
|
|
})
|