MCPcopy Create free account
hub / github.com/prisma/prisma-examples / createDraft

Method createDraft

orm/nest/src/app.controller.ts:66–79  ·  view source on GitHub ↗
(
    @Body() postData: { title: string; content?: string; authorEmail: string },
  )

Source from the content-addressed store, hash-verified

64
65 @Post('post')
66 async createDraft(
67 @Body() postData: { title: string; content?: string; authorEmail: string },
68 ): Promise<PostModel> {
69 const { title, content, authorEmail } = postData;
70 return this.prismaService.extendedPrismaClient().post.create({
71 data: {
72 title,
73 content,
74 author: {
75 connect: { email: authorEmail },
76 },
77 },
78 });
79 }
80
81 @Post('signup')
82 async signupUser(

Callers 1

mainFunction · 0.45

Calls 1

extendedPrismaClientMethod · 0.80

Tested by

no test coverage detected