WRITABLE_PATH is mandatory, so simplify the code logic

This commit is contained in:
Martin Filser 2022-04-03 15:14:38 +02:00
parent d63f1b740c
commit 927f155078
3 changed files with 6 additions and 12 deletions

View file

@ -28,10 +28,8 @@ Attachments = new FilesCollection({
return ret;
},
storagePath() {
if (process.env.WRITABLE_PATH) {
return path.join(process.env.WRITABLE_PATH, 'uploads', 'attachments');
}
return path.normalize(`assets/app/uploads/${this.collectionName}`);
const ret = path.join(process.env.WRITABLE_PATH, 'attachments');
return ret;
},
onAfterUpload(fileObj) {
Object.keys(fileObj.versions).forEach(versionName => {