mirror of
https://github.com/wekan/wekan.git
synced 2025-12-24 03:10:12 +01:00
Move Attachment to other storages now possible
This commit is contained in:
parent
536fb00d61
commit
44fd652b05
9 changed files with 383 additions and 99 deletions
|
|
@ -1,17 +1,12 @@
|
|||
import { createObjectId } from '../grid/createObjectId';
|
||||
|
||||
export const createOnAfterRemove = bucket =>
|
||||
function onAfterRemove(files) {
|
||||
files.forEach(file => {
|
||||
Object.keys(file.versions).forEach(versionName => {
|
||||
const gridFsFileId = (file.versions[versionName].meta || {})
|
||||
.gridFsFileId;
|
||||
if (gridFsFileId) {
|
||||
const gfsId = createObjectId({ gridFsFileId });
|
||||
bucket.delete(gfsId, err => {
|
||||
// if (err) console.error(err);
|
||||
});
|
||||
}
|
||||
export const createOnAfterRemove =
|
||||
function onAfterRemove(filesCollection, bucket, file, versionName) {
|
||||
const gridFsFileId = (file.versions[versionName].meta || {})
|
||||
.gridFsFileId;
|
||||
if (gridFsFileId) {
|
||||
const gfsId = createObjectId({ gridFsFileId });
|
||||
bucket.delete(gfsId, err => {
|
||||
});
|
||||
});
|
||||
}
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue