(comment)
| 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 { |