added chapter view, fixes, added ratings, added chapter updates/deletions

This commit is contained in:
lnn0q 2025-06-01 00:37:26 +03:00
parent 029b7e9353
commit 4801cf3a13
34 changed files with 1345 additions and 191 deletions

View file

@ -6,12 +6,12 @@ import { toBookChapterSchema } from './mappers/bookChapterMapper';
export async function BookChapterOneResolver(
_: any,
{ id }: QueryBookChapterOneArgs,
{ identity }: IdentityContext
{ req, res, identity }: IdentityContext
): Promise<BookChapter> {
const model = await prisma.bookChapter.findUniqueOrThrow({
where: {
id
}
});
return toBookChapterSchema(model);
return toBookChapterSchema(model, { req, res, identity });
}