Settings manages folders, thumbnail defaults, and passwords for the signed-in account, and choosing an image now browses saved stills instead of only the desktop file dialog. Co-authored-by: Cursor <cursoragent@cursor.com>
23 lines
715 B
TypeScript
23 lines
715 B
TypeScript
export default defineEventHandler(async (event) => {
|
|
const { owner } = assertLibraryOwner(event)
|
|
const id = String(getRouterParam(event, 'id') || '')
|
|
const body = await readBody<{
|
|
name?: string
|
|
thumbnailDefault?: boolean
|
|
password?: string | null
|
|
currentPassword?: string
|
|
}>(event)
|
|
const folder = await updateFolder(owner, id, {
|
|
name: body?.name,
|
|
thumbnailDefault: body?.thumbnailDefault,
|
|
password: body?.password,
|
|
currentPassword: body?.currentPassword
|
|
})
|
|
if (body?.password) {
|
|
setFolderUnlock(event, folder.id, passwordVersion(folder.passwordHash))
|
|
} else if (body?.password === '') {
|
|
clearFolderUnlock(event, folder.id)
|
|
}
|
|
return publicLibrary(event)
|
|
})
|