2023-12-20 17:23:31 -05:00
|
|
|
import { storyQuerier } from "@server/dbHelpers";
|
|
|
|
import { Review } from "@models/stories/review";
|
2023-10-02 21:43:24 -04:00
|
|
|
|
|
|
|
export default eventHandler(async (ev) => {
|
|
|
|
let story = await storyQuerier(ev);
|
2023-12-11 21:29:46 -05:00
|
|
|
return await Review.find({
|
2023-10-02 21:43:24 -04:00
|
|
|
whichChapter: story.chapters[ev.context.chapterIndex || 0].id,
|
|
|
|
replyingTo: null,
|
2023-12-11 21:29:46 -05:00
|
|
|
}).exec();
|
2023-10-02 21:43:24 -04:00
|
|
|
});
|