Finished relation picker for companies (#305)

* Finished relation picker for companies

* Minor fixes
This commit is contained in:
Lucas Bordeau
2023-06-15 16:53:59 +02:00
committed by GitHub
parent f0910b3fbb
commit d28a762661
10 changed files with 741 additions and 63 deletions

View File

@ -9,6 +9,7 @@ import { CreateOneCommentThreadArgs } from '../@generated/comment-thread/create-
import { CreateOneCommentThreadGuard } from './guards/create-one-comment-thread.guard';
import { FindManyCommentThreadArgs } from '../@generated/comment-thread/find-many-comment-thread.args';
import { ArgsService } from './services/args.service';
import { UpdateOneCommentThreadArgs } from '../@generated/comment-thread/update-one-comment-thread.args';
@UseGuards(JwtAuthGuard)
@Resolver(() => CommentThread)
@ -67,6 +68,20 @@ export class CommentThreadResolver {
return createdCommentThread;
}
@Mutation(() => CommentThread, {
nullable: false,
})
async updateOneCommentThread(
@Args() args: UpdateOneCommentThreadArgs,
): Promise<CommentThread> {
const updatedCommentThread = await this.prismaService.commentThread.update({
data: args.data,
where: args.where,
});
return updatedCommentThread;
}
@Query(() => [CommentThread])
async findManyCommentThreads(
@Args() args: FindManyCommentThreadArgs,