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