Self-hosted personal gallery application with online photo management and albums, supporting Live/Motion Photos, EXIF parsing, geolocation recognition, and an explore map.
TypeScript albumsexif-extractiongeocodinglive-photomotion-photophoto-galleryphoto-sharingwebgl-viewer
import { requireAdminSession } from '../../../utils/require-admin.ts'
import { z } from 'zod'
import {
useAlbumWriter,
mutationResponse,
} from '../../../utils/resource-writer'
export default eventHandler(async (event) => {
await requireAdminSession(event)
const { albumId } = await getValidatedRouterParams(
event,
z.object({
albumId: z
.string()
.regex(/^\d+$/)
.transform((val) => parseInt(val, 10)),
}).parse,
)
return mutationResponse(() =>
useAlbumWriter().delete(albumId, { authenticated: true }),
)
})