feat: Comment resolving (#7115)

This commit is contained in:
Tom Moor
2024-07-02 06:55:16 -04:00
committed by GitHub
parent f34557337d
commit 117c4f5009
38 changed files with 1126 additions and 291 deletions

View File

@@ -1,4 +1,5 @@
import { z } from "zod";
import { CommentStatusFilter } from "@shared/types";
import { BaseSchema, ProsemirrorSchema } from "@server/routes/api/schema";
const BaseIdSchema = z.object({
@@ -57,7 +58,12 @@ export const CommentsListSchema = BaseSchema.extend({
body: CommentsSortParamsSchema.extend({
/** Id of a document to list comments for */
documentId: z.string().optional(),
collectionId: z.string().uuid().optional(),
/** Id of a collection to list comments for */
collectionId: z.string().optional(),
/** Id of a parent comment to list comments for */
parentCommentId: z.string().uuid().optional(),
/** Comment statuses to include in results */
statusFilter: z.nativeEnum(CommentStatusFilter).array().optional(),
}),
});
@@ -68,3 +74,15 @@ export const CommentsInfoSchema = z.object({
});
export type CommentsInfoReq = z.infer<typeof CommentsInfoSchema>;
export const CommentsResolveSchema = z.object({
body: BaseIdSchema,
});
export type CommentsResolveReq = z.infer<typeof CommentsResolveSchema>;
export const CommentsUnresolveSchema = z.object({
body: BaseIdSchema,
});
export type CommentsUnresolveReq = z.infer<typeof CommentsUnresolveSchema>;