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 { CreateOneCommentThreadGuard } from '../../../guards/create-one-comment-
|
||||
import { FindManyCommentThreadArgs } from '../../../core/@generated/comment-thread/find-many-comment-thread.args';
|
||||
import { CommentThreadService } from '../services/comment-thread.service';
|
||||
import { UpdateOneCommentThreadArgs } from 'src/core/@generated/comment-thread/update-one-comment-thread.args';
|
||||
import { Prisma } from '@prisma/client';
|
||||
import {
|
||||
PrismaSelector,
|
||||
PrismaSelect,
|
||||
@ -27,6 +26,7 @@ import { AppAbility } from 'src/ability/ability.factory';
|
||||
import { accessibleBy } from '@casl/prisma';
|
||||
import { AffectedRows } from 'src/core/@generated/prisma/affected-rows.output';
|
||||
import { DeleteManyCommentThreadArgs } from 'src/core/@generated/comment-thread/delete-many-comment-thread.args';
|
||||
import { Prisma } from '@prisma/client';
|
||||
|
||||
@UseGuards(JwtAuthGuard)
|
||||
@Resolver(() => CommentThread)
|
||||
@ -75,7 +75,8 @@ export class CommentThreadResolver {
|
||||
prismaSelect: PrismaSelect<'CommentThread'>,
|
||||
): Promise<Partial<CommentThread>> {
|
||||
const updatedCommentThread = await this.commentThreadService.update({
|
||||
...args,
|
||||
where: args.where,
|
||||
data: args.data,
|
||||
select: prismaSelect.value,
|
||||
} as Prisma.CommentThreadUpdateArgs);
|
||||
|
||||
@ -92,11 +93,15 @@ export class CommentThreadResolver {
|
||||
prismaSelect: PrismaSelect<'CommentThread'>,
|
||||
): Promise<Partial<CommentThread>[]> {
|
||||
const result = await this.commentThreadService.findMany({
|
||||
...args,
|
||||
where: {
|
||||
...args.where,
|
||||
AND: [accessibleBy(ability).CommentThread],
|
||||
},
|
||||
orderBy: args.orderBy,
|
||||
cursor: args.cursor,
|
||||
take: args.take,
|
||||
skip: args.skip,
|
||||
distinct: args.distinct,
|
||||
select: prismaSelect.value,
|
||||
});
|
||||
|
||||
@ -112,7 +117,7 @@ export class CommentThreadResolver {
|
||||
@Args() args: DeleteManyCommentThreadArgs,
|
||||
): Promise<AffectedRows> {
|
||||
return this.commentThreadService.deleteMany({
|
||||
...args,
|
||||
where: args.where,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@ -6,7 +6,6 @@ import { AuthWorkspace } from '../../../decorators/auth-workspace.decorator';
|
||||
import { CreateOneCommentArgs } from '../../../core/@generated/comment/create-one-comment.args';
|
||||
import { Comment } from '../../../core/@generated/comment/comment.model';
|
||||
import { CreateOneCommentGuard } from '../../../guards/create-one-comment.guard';
|
||||
import { Prisma } from '@prisma/client';
|
||||
import { CommentService } from '../services/comment.service';
|
||||
import {
|
||||
PrismaSelector,
|
||||
@ -17,6 +16,7 @@ import { CheckAbilities } from 'src/decorators/check-abilities.decorator';
|
||||
import { CreateCommentAbilityHandler } from 'src/ability/handlers/comment.ability-handler';
|
||||
import { AuthUser } from 'src/decorators/auth-user.decorator';
|
||||
import { User } from 'src/core/@generated/user/user.model';
|
||||
import { Prisma } from '@prisma/client';
|
||||
|
||||
@UseGuards(JwtAuthGuard)
|
||||
@Resolver(() => Comment)
|
||||
|
||||
Reference in New Issue
Block a user