mirror of
https://github.com/wekan/wekan.git
synced 2025-12-20 17:30:13 +01:00
Copy attachment copies now all versions
- for now only the version "original" exists, but as other method already consider that other version's can exist
This commit is contained in:
parent
e37bf2b51d
commit
1516615934
1 changed files with 45 additions and 44 deletions
|
|
@ -353,7 +353,7 @@ export const moveToStorage = function(fileObj, storageDestination, fileStoreStra
|
||||||
};
|
};
|
||||||
|
|
||||||
export const copyFile = function(fileObj, newCardId, fileStoreStrategyFactory) {
|
export const copyFile = function(fileObj, newCardId, fileStoreStrategyFactory) {
|
||||||
const versionName = "original";
|
Object.keys(fileObj.versions).forEach(versionName => {
|
||||||
const strategyRead = fileStoreStrategyFactory.getFileStrategy(fileObj, versionName);
|
const strategyRead = fileStoreStrategyFactory.getFileStrategy(fileObj, versionName);
|
||||||
const readStream = strategyRead.getReadStream();
|
const readStream = strategyRead.getReadStream();
|
||||||
const strategyWrite = fileStoreStrategyFactory.getFileStrategy(fileObj, versionName, STORAGE_NAME_FILESYSTEM);
|
const strategyWrite = fileStoreStrategyFactory.getFileStrategy(fileObj, versionName, STORAGE_NAME_FILESYSTEM);
|
||||||
|
|
@ -403,6 +403,7 @@ export const copyFile = function(fileObj, newCardId, fileStoreStrategyFactory) {
|
||||||
}));
|
}));
|
||||||
|
|
||||||
readStream.pipe(writeStream);
|
readStream.pipe(writeStream);
|
||||||
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
export const rename = function(fileObj, newName, fileStoreStrategyFactory) {
|
export const rename = function(fileObj, newName, fileStoreStrategyFactory) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue