فهرست منبع

use map correctly

zamis 5 سال پیش
والد
کامیت
2307273762
1فایلهای تغییر یافته به همراه2 افزوده شده و 4 حذف شده
  1. 2 4
      src/server/service/file-uploader/gridfs.js

+ 2 - 4
src/server/service/file-uploader/gridfs.js

@@ -44,10 +44,8 @@ module.exports = function(crowi) {
   };
 
   lib.deleteFiles = async function(attachments) {
-    const filenameValues = [];
-    attachments.map((attachment) => {
-      filenameValues.push(attachment.fileName);
-      return;
+    const filenameValues = attachments.map((attachment) => {
+      return attachment.fileName;
     });
 
     const fileIds = await AttachmentFile.find({ filename: { $in: filenameValues } }, { _id: 1 });