|
|
@@ -78,11 +78,11 @@ module.exports = function(crowi) {
|
|
|
}));
|
|
|
};
|
|
|
|
|
|
- commentSchema.methods.removeWithReplies = function(commentId) {
|
|
|
+ commentSchema.methods.removeWithReplies = function() {
|
|
|
const Comment = crowi.model('Comment');
|
|
|
|
|
|
return new Promise(((resolve, reject) => {
|
|
|
- Comment.remove({ $or: [{ replyTo: commentId }, { _id: commentId }] }, (err, done) => {
|
|
|
+ Comment.remove({ $or: [{ replyTo: this._id }, { _id: this._id }] }, (err, done) => {
|
|
|
if (err) {
|
|
|
return reject(err);
|
|
|
}
|