Skip to content

Self-hosted personal gallery application with online photo management and albums, supporting Live/Motion Photos, EXIF parsing, geolocation recognition, and an explore map.

565 B
Raw Blame
import z from 'zod'
import { albumAccess } from '../../../utils/album-access'
import {
  resourceReadResponse,
  useResourceReader,
} from '../../../utils/resource-reader'

export default eventHandler(async (event) => {
  const { albumId } = await getValidatedRouterParams(
    event,
    z.object({
      albumId: z
        .string()
        .regex(/^\d+$/)
        .transform((value) => parseInt(value, 10)),
    }).parse,
  )
  const access = await albumAccess(event)
  return resourceReadResponse(() =>
    useResourceReader().getAlbum(albumId, access),
  )
})