Feat/5870 list all comments (#6081)

This commit is contained in:
Pranav Joglekar
2023-11-18 05:54:26 +05:30
committed by GitHub
parent 5c03908529
commit 750c324b1a
5 changed files with 215 additions and 12 deletions

View File

@@ -32,6 +32,7 @@ import {
Notification,
SearchQuery,
Pin,
Comment,
} from "@server/models";
import AttachmentHelper from "@server/models/helpers/AttachmentHelper";
@@ -395,6 +396,34 @@ export async function buildDocument(
return document;
}
export async function buildComment(overrides: {
userId: string;
teamId: string;
documentId: string;
}) {
const comment = await Comment.create({
teamId: overrides.teamId,
documentId: overrides.documentId,
data: {
type: "doc",
content: [
{
type: "paragraph",
content: [
{
type: "text",
text: "test",
},
],
},
],
},
createdById: overrides.userId,
});
return comment;
}
export async function buildFileOperation(
overrides: Partial<FileOperation> = {}
) {