Board copy moves the attachments to the "copied from board storage"

pull/4496/head
Martin Filser 3 years ago
parent fbb0ed5ec1
commit 000e27a4a1
  1. 3
      models/attachments.js
  2. 1
      models/lib/fileStoreStrategy.js

@ -34,12 +34,13 @@ Attachments = new FilesCollection({
return ret;
},
onAfterUpload(fileObj) {
let storage = fileObj.meta.copyStorage || STORAGE_NAME_GRIDFS;
// current storage is the filesystem, update object and database
Object.keys(fileObj.versions).forEach(versionName => {
fileObj.versions[versionName].storage = STORAGE_NAME_FILESYSTEM;
});
Attachments.update({ _id: fileObj._id }, { $set: { "versions" : fileObj.versions } });
moveToStorage(fileObj, STORAGE_NAME_GRIDFS, fileStoreStrategyFactory);
moveToStorage(fileObj, storage, fileStoreStrategyFactory);
},
interceptDownload(http, fileObj, versionName) {
const ret = fileStoreStrategyFactory.getFileStrategy(fileObj, versionName).interceptDownload(http, this.cacheControl);

@ -369,6 +369,7 @@ export const copyFile = function(fileObj, newCardId, fileStoreStrategyFactory) {
swimlaneId: fileObj.meta.swimlaneId,
source: 'copy',
copyFrom: fileObj._id,
copyStorage: strategyRead.getStorageName(),
},
userId: fileObj.userId,
size: fileObj.fileSize,

Loading…
Cancel
Save