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);
     });