From 9116b4d1268b096543c7ab034d5f2b1f4839b665 Mon Sep 17 00:00:00 2001 From: charlesgauthereau Date: Thu, 19 Feb 2026 21:09:56 +0100 Subject: [PATCH] fix: type error when user add port for s3 storages. --- .../channels/channel/channel-form/channel-test-button.tsx | 3 ++- src/features/storages/dispatch.ts | 4 +++- src/features/storages/providers/s3.ts | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/components/wrappers/dashboard/admin/channels/channel/channel-form/channel-test-button.tsx b/src/components/wrappers/dashboard/admin/channels/channel/channel-form/channel-test-button.tsx index bb4c495d..5c4fdf00 100644 --- a/src/components/wrappers/dashboard/admin/channels/channel/channel-form/channel-test-button.tsx +++ b/src/components/wrappers/dashboard/admin/channels/channel/channel-form/channel-test-button.tsx @@ -51,7 +51,8 @@ export const ChannelTestButton = ({channel, organizationId, kind}: NotifierTestC toast.success("Successfully connected to storage channel"); } else { console.error(result); - toast.error("An error occurred while testing the storage channel, check your configuration"); + const responseText = result.response ? `(${result.response})` : ""; + toast.error(`An error occurred while testing the storage channel, check your configuration ${responseText}`); } } else { toast.error("Not yet supported"); diff --git a/src/features/storages/dispatch.ts b/src/features/storages/dispatch.ts index 32b87fc8..d13fef6c 100644 --- a/src/features/storages/dispatch.ts +++ b/src/features/storages/dispatch.ts @@ -97,12 +97,14 @@ export async function dispatchStorage( } - return await dispatchViaProvider( + const dispatchResult = await dispatchViaProvider( channel.provider as StorageProviderKind, channel.config, input, ); + console.log(dispatchResult); + return dispatchResult; } catch (err: any) { return { diff --git a/src/features/storages/providers/s3.ts b/src/features/storages/providers/s3.ts index f03f3372..6bdc8b29 100644 --- a/src/features/storages/providers/s3.ts +++ b/src/features/storages/providers/s3.ts @@ -18,7 +18,7 @@ async function getS3Client(config: S3Config) { region: config.region ?? "us-east-1", accessKey: config.accessKey, secretKey: config.secretKey, - port: config.port ?? 443, + port: config.port ? Number(config.port) : 443, useSSL: config.ssl ?? true, }); }