zamis 5 лет назад
Родитель
Сommit
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;
   }
 
 }