فهرست منبع

BugFix: removeWithSubstanceById

Yuki Takei 7 سال پیش
والد
کامیت
336ed1e5a5
1فایلهای تغییر یافته به همراه1 افزوده شده و 1 حذف شده
  1. 1 1
      src/server/models/attachment.js

+ 1 - 1
src/server/models/attachment.js

@@ -93,7 +93,7 @@ module.exports = function(crowi) {
     // retrieve data from DB to get a completely populated instance
     // retrieve data from DB to get a completely populated instance
     const attachment = await this.findById(id);
     const attachment = await this.findById(id);
     await fileUploader.deleteFile(attachment);
     await fileUploader.deleteFile(attachment);
-    return await this.remove();
+    return await attachment.remove();
   };
   };
 
 
   return mongoose.model('Attachment', attachmentSchema);
   return mongoose.model('Attachment', attachmentSchema);