|
|
@@ -3,6 +3,7 @@ module.exports = function(crowi) {
|
|
|
, mongoose = require('mongoose')
|
|
|
, ObjectId = mongoose.Schema.Types.ObjectId
|
|
|
, fileUploader = require('../util/fileUploader')(crowi)
|
|
|
+ , attachmentSchema
|
|
|
;
|
|
|
|
|
|
function generateFileHash(fileName) {
|
|
|
@@ -140,7 +141,7 @@ module.exports = function(crowi) {
|
|
|
return new Promise((resolve, reject) => {
|
|
|
Attachment.getListByPageId(pageId)
|
|
|
.then((attachments) => {
|
|
|
- for (attachment of attachments) {
|
|
|
+ for (let attachment of attachments) {
|
|
|
Attachment.removeAttachment(attachment).then((res) => {
|
|
|
// do nothing
|
|
|
}).catch((err) => {
|
|
|
@@ -157,10 +158,8 @@ module.exports = function(crowi) {
|
|
|
};
|
|
|
|
|
|
attachmentSchema.statics.findDeliveryFile = function(attachment, forceUpdate) {
|
|
|
- var Attachment = this;
|
|
|
-
|
|
|
- // TODO
|
|
|
- var forceUpdate = forceUpdate || false;
|
|
|
+ // TODO force update
|
|
|
+ // var forceUpdate = forceUpdate || false;
|
|
|
|
|
|
return fileUploader.findDeliveryFile(attachment._id, attachment.filePath);
|
|
|
};
|