Address Greptile deleted-comment feedback

Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
Dotta
2026-06-05 03:43:12 +00:00
parent cf0ec9933a
commit 1afa337841
5 changed files with 91 additions and 35 deletions
+2 -2
View File
@@ -1,4 +1,4 @@
import { and, asc, desc, eq, inArray, sql } from "drizzle-orm";
import { and, asc, desc, eq, inArray, isNull, sql } from "drizzle-orm";
import type { Db } from "@paperclipai/db";
import {
documentAnnotationAnchorSnapshots,
@@ -155,7 +155,7 @@ export function documentAnnotationService(db: Db) {
issueId: issueComments.issueId,
})
.from(issueComments)
.where(eq(issueComments.id, commentId))
.where(and(eq(issueComments.id, commentId), isNull(issueComments.deletedAt)))
.then((rows: Array<{ id: string; companyId: string; issueId: string }>) => rows[0] ?? null);
if (!comment || comment.issueId !== issueId) {
throw unprocessable("Linked issue comment must belong to this issue");