import type { WebNovel } from '~/types'

export default defineEventHandler(async (): Promise<WebNovel[]> => {
  const novels = await queryCollection('content').all() as WebNovel[]

  // Filter to only include index files (no chapters)
  return novels.filter(n => !n._path?.includes('/ch-')) as WebNovel[]
})
