feat: add filterComment function for comment responses
This commit is contained in:
@@ -60,6 +60,21 @@ export function filterPage(page: any, content?: string, subpages?: any[]) {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function filterComment(comment: any, markdownContent?: string) {
|
||||||
|
return {
|
||||||
|
id: comment.id,
|
||||||
|
pageId: comment.pageId,
|
||||||
|
content: markdownContent ?? comment.content,
|
||||||
|
selection: comment.selection || null,
|
||||||
|
type: comment.type || "page",
|
||||||
|
parentCommentId: comment.parentCommentId || null,
|
||||||
|
creatorId: comment.creatorId,
|
||||||
|
creatorName: comment.creator?.name || null,
|
||||||
|
createdAt: comment.createdAt,
|
||||||
|
editedAt: comment.editedAt || null,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
export function filterSearchResult(result: any) {
|
export function filterSearchResult(result: any) {
|
||||||
return {
|
return {
|
||||||
id: result.id,
|
id: result.id,
|
||||||
|
|||||||
Reference in New Issue
Block a user