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:
@ -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,
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user