We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 9c21b6e commit 68d714dCopy full SHA for 68d714d
1 file changed
pages/api/teams/[teamId]/documents/[id]/annotations/index.ts
@@ -5,7 +5,7 @@ import { getServerSession } from "next-auth/next";
5
import { z } from "zod";
6
7
import { errorhandler } from "@/lib/errorHandler";
8
-import prisma from "@/lib/prisma";
+import prisma, { Prisma } from "@/lib/prisma";
9
import { getTeamWithUsersAndDocument } from "@/lib/team/helper";
10
import { CustomUser } from "@/lib/types";
11
import { log } from "@/lib/utils";
@@ -81,6 +81,7 @@ export default async function handle(
81
const annotation = await prisma.documentAnnotation.create({
82
data: {
83
...validatedData,
84
+ content: validatedData.content ?? Prisma.JsonNull, // Convert undefined to Prisma.JsonNull
85
documentId: docId,
86
teamId,
87
createdById: userId,
0 commit comments