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:
Jérémy M
2023-07-07 02:05:15 +02:00
committed by GitHub
parent 0b7a023f3d
commit 1144bd13ed
141 changed files with 2660 additions and 962 deletions

View File

@ -8,8 +8,7 @@ import { UpdateOneCompanyArgs } from '../../core/@generated/company/update-one-c
import { CreateOneCompanyArgs } from '../../core/@generated/company/create-one-company.args';
import { AffectedRows } from '../../core/@generated/prisma/affected-rows.output';
import { DeleteManyCompanyArgs } from '../../core/@generated/company/delete-many-company.args';
import { Workspace } from '@prisma/client';
import { Prisma } from '@prisma/client';
import { Prisma, Workspace } from '@prisma/client';
import { UpdateOneGuard } from '../../guards/update-one.guard';
import { DeleteManyGuard } from '../../guards/delete-many.guard';
import { CreateOneGuard } from '../../guards/create-one.guard';
@ -45,12 +44,16 @@ export class CompanyResolver {
prismaSelect: PrismaSelect<'Company'>,
): Promise<Partial<Company>[]> {
return this.companyService.findMany({
...args,
where: args.where
? {
AND: [args.where, accessibleBy(ability).Company],
}
: accessibleBy(ability).Company,
orderBy: args.orderBy,
cursor: args.cursor,
take: args.take,
skip: args.skip,
distinct: args.distinct,
select: prismaSelect.value,
});
}
@ -71,7 +74,8 @@ export class CompanyResolver {
}
return this.companyService.update({
...args,
where: args.where,
data: args.data,
select: prismaSelect.value,
} as Prisma.CompanyUpdateArgs);
}
@ -86,7 +90,7 @@ export class CompanyResolver {
@Args() args: DeleteManyCompanyArgs,
): Promise<AffectedRows> {
return this.companyService.deleteMany({
...args,
where: args.where,
});
}