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.

442 B
Raw Blame
import {
  usePhotoWriter,
  mutationResponse,
} from '../../../utils/resource-writer'

export default eventHandler(async (event) => {
  await requireUserSession(event)
  const photoId = getRouterParam(event, 'photoId')
  if (!photoId)
    throw createError({
      statusCode: 400,
      statusMessage: 'Photo ID is required',
    })
  return mutationResponse(() =>
    usePhotoWriter(event).delete(photoId, { authenticated: true }),
  )
})