(
@Body()
userData: {
name?: string;
email: string;
posts?: Prisma.PostCreateInput[];
},
)
| 80 | |
| 81 | @Post('signup') |
| 82 | async signupUser( |
| 83 | @Body() |
| 84 | userData: { |
| 85 | name?: string; |
| 86 | email: string; |
| 87 | posts?: Prisma.PostCreateInput[]; |
| 88 | }, |
| 89 | ): Promise<UserModel> { |
| 90 | const postData = userData.posts?.map((post) => { |
| 91 | return { title: post?.title, content: post?.content }; |
| 92 | }); |
| 93 | return this.prismaService.extendedPrismaClient().user.create({ |
| 94 | data: { |
| 95 | name: userData?.name, |
| 96 | email: userData.email, |
| 97 | posts: { |
| 98 | create: postData, |
| 99 | }, |
| 100 | }, |
| 101 | }); |
| 102 | } |
| 103 | |
| 104 | @Put('publish/:id') |
| 105 | async togglePublishPost(@Param('id') id: string): Promise<PostModel> { |
no test coverage detected