mirror of
https://github.com/wekan/wekan.git
synced 2026-01-02 07:38:49 +01:00
removed createOnAfterUpload file and use existing code for initial file move to GridFS
This commit is contained in:
parent
fe018225b4
commit
9ef45a75af
4 changed files with 18 additions and 53 deletions
|
|
@ -32,9 +32,12 @@ Attachments = new FilesCollection({
|
|||
return ret;
|
||||
},
|
||||
onAfterUpload(fileObj) {
|
||||
// current storage is the filesystem, update object and database
|
||||
Object.keys(fileObj.versions).forEach(versionName => {
|
||||
fileStoreStrategyFactory.getFileStrategy(this, fileObj, versionName).onAfterUpload();
|
||||
})
|
||||
fileObj.versions[versionName].storage = "fs";
|
||||
});
|
||||
Attachments.update({ _id: fileObj._id }, { $set: { "versions" : fileObj.versions } });
|
||||
moveToStorage(fileObj, "gridfs", fileStoreStrategyFactory);
|
||||
},
|
||||
interceptDownload(http, fileObj, versionName) {
|
||||
const ret = fileStoreStrategyFactory.getFileStrategy(this, fileObj, versionName).interceptDownload(http);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue