Files
aigen/server/api/library/stills/[id]/keep-input.post.ts
T

11 lines
452 B
TypeScript

import { assertFolderAccess, getStill, keepStillAsInput, libraryOwnerKey, publicLibrary } from '~/server/utils/library'
export default defineEventHandler(async (event) => {
const id = String(getRouterParam(event, 'id') || '')
const owner = libraryOwnerKey(event)
const still = getStill(owner, id)
assertFolderAccess(event, still.folderId)
const saved = await keepStillAsInput(owner, id)
return { still: saved, ...publicLibrary(event) }
})