11 lines
452 B
TypeScript
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) }
|
|
})
|