lastwebnovel-app/server/api/novels/index.ts
2026-04-11 22:55:16 +02:00

9 lines
308 B
TypeScript

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[]
})