MCPcopy Index your code
hub / github.com/dev-mastery/comments-api / softDelete

Function softDelete

src/use-cases/remove-comment.js:57–72  ·  view source on GitHub ↗
(commentInfo)

Source from the content-addressed store, hash-verified

55 }
56
57 async function softDelete (commentInfo) {
58 const toDelete = makeComment(commentInfo)
59 toDelete.markDeleted()
60 await commentsDb.update({
61 id: toDelete.getId(),
62 author: toDelete.getAuthor(),
63 text: toDelete.getText(),
64 replyToId: toDelete.getReplyToId(),
65 postId: toDelete.getPostId()
66 })
67 return {
68 deletedCount: 1,
69 softDelete: true,
70 message: 'Comment has replies. Soft deleted.'
71 }
72 }
73
74 async function deleteCommentAndParent (comment) {
75 await Promise.all([

Callers 1

makeRemoveCommentFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected