fixes
This commit is contained in:
parent
c8f68b7486
commit
e5126a4aca
6 changed files with 56 additions and 288 deletions
|
|
@ -1,9 +1,9 @@
|
|||
import { call } from '@app/common';
|
||||
import { ensureIdentity } from '@app/server/helpers';
|
||||
import { IdentityContext } from '@app/server/identity';
|
||||
import { prisma, uuid } from '@app/server/prisma/client';
|
||||
import { prisma } from '@app/server/prisma/client';
|
||||
import { MutationUserUpdateArgs, User } from '@generated/types';
|
||||
import { toUserSchema } from './mappers/userMapper';
|
||||
import { call } from '@app/common';
|
||||
|
||||
export async function UserUpdateResolver(
|
||||
_: any,
|
||||
|
|
@ -12,7 +12,7 @@ export async function UserUpdateResolver(
|
|||
): Promise<User> {
|
||||
ensureIdentity(identity);
|
||||
|
||||
if (input.id != identity.id) throw new Error('Operation is not permitted.'); //todo: add admin access
|
||||
if (input.id !== identity.id) throw new Error('Operation is not permitted.');
|
||||
|
||||
if (input.description != null && input.description.length > 700)
|
||||
throw new Error('Description is too long.');
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue