MCPcopy
hub / github.com/dev-mastery/comments-api / isOnlyReplyOfDeletedParent

Function isOnlyReplyOfDeletedParent

src/use-cases/remove-comment.js:34–47  ·  view source on GitHub ↗
(comment)

Source from the content-addressed store, hash-verified

32 }
33
34 async function isOnlyReplyOfDeletedParent (comment) {
35 if (!comment.replyToId) {
36 return false
37 }
38 const parent = await commentsDb.findById({ id: comment.replyToId })
39 if (parent && makeComment(parent).isDeleted()) {
40 const replies = await commentsDb.findReplies({
41 commentId: parent.id,
42 publishedOnly: false
43 })
44 return replies.length === 1
45 }
46 return false
47 }
48
49 function deleteNothing () {
50 return {

Callers 1

makeRemoveCommentFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected