From 6caa1311fd117d4a5e7624a207b48f0aa5e01e37 Mon Sep 17 00:00:00 2001 From: Ahmed Bouhuolia Date: Tue, 1 Oct 2024 15:09:21 +0200 Subject: [PATCH] fix: Getting uploaded object uri --- packages/server/src/services/Attachments/utils.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/packages/server/src/services/Attachments/utils.ts b/packages/server/src/services/Attachments/utils.ts index 50af9da9d..4f58fbc9c 100644 --- a/packages/server/src/services/Attachments/utils.ts +++ b/packages/server/src/services/Attachments/utils.ts @@ -1,7 +1,9 @@ import path from 'path'; import config from '@/config'; - export const getUploadedObjectUri = (objectKey: string) => { - return path.join(config.s3.endpoint, config.s3.bucket, objectKey); -} \ No newline at end of file + return new URL( + path.join(config.s3.bucket, objectKey), + config.s3.endpoint + ).toString(); +};