☙◦ The Tablet ❀ GamerGirlandCo ◦❧
088232f750
create an index file which exports the functions we need in one accessible place
14 lines
489 B
TypeScript
14 lines
489 B
TypeScript
import { chapterTransformer } from "~/lib/server/dbHelpers";
|
|
import { storyQuerier } from "~/lib/server/dbHelpers";
|
|
import storyCheck from "~/lib/server/middlewareButNotReally/storyCheck";
|
|
|
|
export default eventHandler(async (ev) => {
|
|
const story = await storyQuerier(ev);
|
|
const bi = parseInt(getRouterParam(ev, "chapter")!);
|
|
const chres = await storyCheck(ev, story, bi - 1);
|
|
if (chres != null) {
|
|
throw createError(chres);
|
|
}
|
|
return await chapterTransformer(story, ev, bi - 1);
|
|
});
|