(comment)
| 72 | } |
| 73 | |
| 74 | async function deleteCommentAndParent (comment) { |
| 75 | await Promise.all([ |
| 76 | commentsDb.remove(comment), |
| 77 | commentsDb.remove({ id: comment.replyToId }) |
| 78 | ]) |
| 79 | return { |
| 80 | deletedCount: 2, |
| 81 | softDelete: false, |
| 82 | message: 'Comment and parent deleted.' |
| 83 | } |
| 84 | } |
| 85 | |
| 86 | async function hardDelete (comment) { |
| 87 | await commentsDb.remove(comment) |