Yuki Takei 6 年之前
父節點
當前提交
6bae6a4e7a
共有 1 個文件被更改,包括 2 次插入2 次删除
  1. 2 2
      src/server/models/attachment.js

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

@@ -69,9 +69,9 @@ module.exports = function(crowi) {
   };
 
   attachmentSchema.statics.removeAttachmentsByPageId = async function(pageId) {
-    const attachments = this.find({ page: pageId });
+    const attachments = await this.find({ page: pageId });
 
-    const promises = attachments.map((attachment) => {
+    const promises = attachments.map(async(attachment) => {
       return this.removeWithSubstanceById(attachment._id);
     });