Browse Source

clean code

zamis 5 years ago
parent
commit
8e57c897e0
1 changed files with 1 additions and 3 deletions
  1. 1 3
      src/server/service/attachment.js

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

@@ -44,12 +44,10 @@ class AttachmentService {
   }
   }
 
 
   async removeAttachment(attachments) {
   async removeAttachment(attachments) {
-    const Attachment = this.crowi.model('Attachment');
     const { fileUploadService } = this.crowi;
     const { fileUploadService } = this.crowi;
 
 
-    await attachments.forEach(attachment => Attachment.findById(attachment._id));
     await attachments.forEach(attachment => fileUploadService.deleteFile(attachment));
     await attachments.forEach(attachment => fileUploadService.deleteFile(attachment));
-    return attachments.forEach(attachment => attachment.remove());
+    await attachments.forEach(attachment => attachment.remove());
   }
   }
 
 
 }
 }