mirror of
https://github.com/wekan/wekan.git
synced 2025-12-16 23:40:13 +01:00
Board copy moves the attachments to the "copied from board storage"
This commit is contained in:
parent
fbb0ed5ec1
commit
000e27a4a1
2 changed files with 3 additions and 1 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue