import { storyQuerier } from "~/lib/server/dbHelpers"; import { Review } from "~/models/stories/review"; export default eventHandler(async (ev) => { let story = await storyQuerier(ev); return await Review.find({ whichChapter: story.chapters[ev.context.chapterIndex || 0].id, replyingTo: null, }).exec(); });