zamis 5 年 前
コミット
71f9a74a94
1 ファイル変更3 行追加5 行削除
  1. 3 5
      src/server/service/attachment.js

+ 3 - 5
src/server/service/attachment.js

@@ -45,15 +45,13 @@ class AttachmentService {
 
   async removeAttachment(attachments) {
     const { fileUploadService } = this.crowi;
-    const attachmentsCollection = mongoose.connection.collection('attachments');
-    const unorderAttachmentsBulkOp = attachmentsCollection.initializeUnorderedBulkOp();
 
     attachments.forEach((attachment) => {
-      fileUploadService.deleteFile(attachment);
-      unorderAttachmentsBulkOp.find({ _id: attachment._id }).remove();
+      fileUploadService.deleteFiles(attachment);
+      attachment.find({ _id: attachment._id }).remove();
     });
 
-    return unorderAttachmentsBulkOp.execute();
+    return;
   }
 
 }