From c91f21f8e240f20eb272060859d976f41897166b Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Wed, 24 Mar 2021 18:31:13 +0000 Subject: [PATCH] Fixing an issue with attachments. --- packages/server/src/constants/index.js | 2 +- packages/server/src/utilities/fileSystem/utilities.js | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/server/src/constants/index.js b/packages/server/src/constants/index.js index ed37e65dce..379cfb8aa5 100644 --- a/packages/server/src/constants/index.js +++ b/packages/server/src/constants/index.js @@ -90,6 +90,6 @@ exports.BaseQueryVerbs = { exports.ObjectStoreBuckets = { BACKUPS: "backups", - APPS: "apps", + APPS: "prod-budi-app-assets", TEMPLATES: "templates", } diff --git a/packages/server/src/utilities/fileSystem/utilities.js b/packages/server/src/utilities/fileSystem/utilities.js index cfdbc3b811..db515106c0 100644 --- a/packages/server/src/utilities/fileSystem/utilities.js +++ b/packages/server/src/utilities/fileSystem/utilities.js @@ -112,6 +112,8 @@ exports.upload = async ({ bucket, filename, path, type, metadata }) => { const fileBytes = fs.readFileSync(path) const objectStore = exports.ObjectStore(bucket) + await exports.makeSureBucketExists(objectStore, bucket) + const config = { // windows file paths need to be converted to forward slashes for s3 Key: sanitize(filename).replace(/\\/g, "/"),