Yuki Takei 6 лет назад
Родитель
Сommit
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);
     });