feat: onboarding & profile edition (#507)
* feat: wip onboarding * fix: generate graphql front * wip: onboarding * feat: login/register and edit profile * fix: unused import * fix: test * Use DEBUG_MODE instead of STAGE and mute typescript depth exceed errors * Fix seeds * Fix onboarding when coming from google * Fix * Fix lint * Fix ci * Fix tests --------- Co-authored-by: Charles Bochet <charles@twenty.com>
This commit is contained in:
@ -9,7 +9,6 @@ import { AffectedRows } from '../../core/@generated/prisma/affected-rows.output'
|
||||
import { DeleteManyPersonArgs } from '../../core/@generated/person/delete-many-person.args';
|
||||
import { Workspace } from '../../core/@generated/workspace/workspace.model';
|
||||
import { AuthWorkspace } from '../../decorators/auth-workspace.decorator';
|
||||
import { Prisma } from '@prisma/client';
|
||||
import { UpdateOneGuard } from '../../guards/update-one.guard';
|
||||
import { DeleteManyGuard } from '../../guards/delete-many.guard';
|
||||
import { CreateOneGuard } from '../../guards/create-one.guard';
|
||||
@ -29,6 +28,7 @@ import {
|
||||
import { UserAbility } from 'src/decorators/user-ability.decorator';
|
||||
import { AppAbility } from 'src/ability/ability.factory';
|
||||
import { accessibleBy } from '@casl/prisma';
|
||||
import { Prisma } from '@prisma/client';
|
||||
|
||||
@UseGuards(JwtAuthGuard)
|
||||
@Resolver(() => Person)
|
||||
@ -47,12 +47,16 @@ export class PersonResolver {
|
||||
prismaSelect: PrismaSelect<'Person'>,
|
||||
): Promise<Partial<Person>[]> {
|
||||
return this.personService.findMany({
|
||||
...args,
|
||||
where: args.where
|
||||
? {
|
||||
AND: [args.where, accessibleBy(ability).Person],
|
||||
}
|
||||
: accessibleBy(ability).Person,
|
||||
orderBy: args.orderBy,
|
||||
cursor: args.cursor,
|
||||
take: args.take,
|
||||
skip: args.skip,
|
||||
distinct: args.distinct,
|
||||
select: prismaSelect.value,
|
||||
});
|
||||
}
|
||||
@ -73,7 +77,8 @@ export class PersonResolver {
|
||||
}
|
||||
|
||||
return this.personService.update({
|
||||
...args,
|
||||
where: args.where,
|
||||
data: args.data,
|
||||
select: prismaSelect.value,
|
||||
} as Prisma.PersonUpdateArgs);
|
||||
}
|
||||
@ -88,7 +93,7 @@ export class PersonResolver {
|
||||
@Args() args: DeleteManyPersonArgs,
|
||||
): Promise<AffectedRows> {
|
||||
return this.personService.deleteMany({
|
||||
...args,
|
||||
where: args.where,
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user