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:
@ -7,7 +7,6 @@ import { AuthWorkspace } from '../../../decorators/auth-workspace.decorator';
|
||||
import { FindManyPipelineProgressArgs } from '../../@generated/pipeline-progress/find-many-pipeline-progress.args';
|
||||
import { PipelineProgress } from '../../@generated/pipeline-progress/pipeline-progress.model';
|
||||
import { UpdateOnePipelineProgressArgs } from '../../@generated/pipeline-progress/update-one-pipeline-progress.args';
|
||||
import { Prisma } from '@prisma/client';
|
||||
import { AffectedRows } from '../../@generated/prisma/affected-rows.output';
|
||||
import { DeleteManyPipelineProgressArgs } from '../../@generated/pipeline-progress/delete-many-pipeline-progress.args';
|
||||
import { CreateOnePipelineProgressArgs } from '../../@generated/pipeline-progress/create-one-pipeline-progress.args';
|
||||
@ -26,6 +25,7 @@ import {
|
||||
PrismaSelector,
|
||||
PrismaSelect,
|
||||
} from 'src/decorators/prisma-select.decorator';
|
||||
import { Prisma } from '@prisma/client';
|
||||
|
||||
@UseGuards(JwtAuthGuard)
|
||||
@Resolver(() => PipelineProgress)
|
||||
@ -40,14 +40,21 @@ export class PipelineProgressResolver {
|
||||
async findManyPipelineProgress(
|
||||
@Args() args: FindManyPipelineProgressArgs,
|
||||
@UserAbility() ability: AppAbility,
|
||||
@PrismaSelector({ modelName: 'PipelineProgress' })
|
||||
prismaSelect: PrismaSelect<'PipelineProgress'>,
|
||||
): Promise<Partial<PipelineProgress>[]> {
|
||||
return this.pipelineProgressService.findMany({
|
||||
...args,
|
||||
where: args.where
|
||||
? {
|
||||
AND: [args.where, accessibleBy(ability).PipelineProgress],
|
||||
}
|
||||
: accessibleBy(ability).PipelineProgress,
|
||||
orderBy: args.orderBy,
|
||||
cursor: args.cursor,
|
||||
take: args.take,
|
||||
skip: args.skip,
|
||||
distinct: args.distinct,
|
||||
select: prismaSelect.value,
|
||||
});
|
||||
}
|
||||
|
||||
@ -62,7 +69,8 @@ export class PipelineProgressResolver {
|
||||
prismaSelect: PrismaSelect<'PipelineProgress'>,
|
||||
): Promise<Partial<PipelineProgress> | null> {
|
||||
return this.pipelineProgressService.update({
|
||||
...args,
|
||||
where: args.where,
|
||||
data: args.data,
|
||||
select: prismaSelect.value,
|
||||
} as Prisma.PipelineProgressUpdateArgs);
|
||||
}
|
||||
@ -76,7 +84,7 @@ export class PipelineProgressResolver {
|
||||
@Args() args: DeleteManyPipelineProgressArgs,
|
||||
): Promise<AffectedRows> {
|
||||
return this.pipelineProgressService.deleteMany({
|
||||
...args,
|
||||
where: args.where,
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@ -30,12 +30,16 @@ export class PipelineStageResolver {
|
||||
prismaSelect: PrismaSelect<'PipelineStage'>,
|
||||
): Promise<Partial<PipelineStage>[]> {
|
||||
return this.pipelineStageService.findMany({
|
||||
...args,
|
||||
where: args.where
|
||||
? {
|
||||
AND: [args.where, accessibleBy(ability).PipelineStage],
|
||||
}
|
||||
: accessibleBy(ability).PipelineStage,
|
||||
orderBy: args.orderBy,
|
||||
cursor: args.cursor,
|
||||
take: args.take,
|
||||
skip: args.skip,
|
||||
distinct: args.distinct,
|
||||
select: prismaSelect.value,
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user