Add manual image groups to the library
This commit is contained in:
@@ -0,0 +1,11 @@
|
||||
export default defineEventHandler(async (event) => {
|
||||
const { owner } = assertLibraryOwner(event)
|
||||
const body = await readBody(event)
|
||||
if (!Array.isArray(body?.ids) || !body.ids.length || body.ids.length > 1000 || body.ids.some((id: unknown) => typeof id !== 'string')) {
|
||||
throw createError({ statusCode: 400, statusMessage: 'Select images to group' })
|
||||
}
|
||||
const ids = [...new Set<string>(body.ids)]
|
||||
for (const id of ids) assertFolderAccess(event, getStill(owner, id).folderId)
|
||||
await groupLibraryStills(owner, ids, body.ungroup === true)
|
||||
return publicLibrary(event)
|
||||
})
|
||||
Reference in New Issue
Block a user