Skip to content

Commit 68d714d

Browse files
committed
fix
1 parent 9c21b6e commit 68d714d

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

  • pages/api/teams/[teamId]/documents/[id]/annotations

pages/api/teams/[teamId]/documents/[id]/annotations/index.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { getServerSession } from "next-auth/next";
55
import { z } from "zod";
66

77
import { errorhandler } from "@/lib/errorHandler";
8-
import prisma from "@/lib/prisma";
8+
import prisma, { Prisma } from "@/lib/prisma";
99
import { getTeamWithUsersAndDocument } from "@/lib/team/helper";
1010
import { CustomUser } from "@/lib/types";
1111
import { log } from "@/lib/utils";
@@ -81,6 +81,7 @@ export default async function handle(
8181
const annotation = await prisma.documentAnnotation.create({
8282
data: {
8383
...validatedData,
84+
content: validatedData.content ?? Prisma.JsonNull, // Convert undefined to Prisma.JsonNull
8485
documentId: docId,
8586
teamId,
8687
createdById: userId,

0 commit comments

Comments
 (0)