added chapter view, fixes, added ratings, added chapter updates/deletions
This commit is contained in:
parent
029b7e9353
commit
4801cf3a13
34 changed files with 1345 additions and 191 deletions
|
|
@ -7,11 +7,10 @@ import { toBookSchema } from './mappers/bookMapper';
|
|||
export async function BookCreateResolver(
|
||||
_: any,
|
||||
{ input }: MutationBookCreateArgs,
|
||||
{ identity }: IdentityContext
|
||||
{ req, res, identity }: IdentityContext
|
||||
): Promise<Book> {
|
||||
ensureIdentity(identity);
|
||||
|
||||
console.log(input.title.length);
|
||||
if (input.title.length > 60) throw new Error('Title is too long.');
|
||||
if (input.description.length > 900) throw new Error('Description is too long.');
|
||||
|
||||
|
|
@ -23,5 +22,5 @@ export async function BookCreateResolver(
|
|||
authorId: identity.id
|
||||
}
|
||||
});
|
||||
return toBookSchema(model);
|
||||
return toBookSchema(model, { req, res, identity });
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue