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