import { storyQuerier } from "@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();
});
