From 6cb4a51aee7bddd59a3267bd060844c8b0134015 Mon Sep 17 00:00:00 2001 From: mehditorabiv Date: Wed, 16 Oct 2024 10:15:11 +0300 Subject: [PATCH] fix --- .../communitySettings/communityPlatforms/TcDiscourse.tsx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/components/communitySettings/communityPlatforms/TcDiscourse.tsx b/src/components/communitySettings/communityPlatforms/TcDiscourse.tsx index a408dde7..5790ab4d 100644 --- a/src/components/communitySettings/communityPlatforms/TcDiscourse.tsx +++ b/src/components/communitySettings/communityPlatforms/TcDiscourse.tsx @@ -57,11 +57,14 @@ function TcDiscourse({ const handleCreateNewPlatform = async () => { try { setIsCreatePlatformLoading(true); + + const cleanedUrl = url.replace(/\/$/, '').replaceAll('https://', '').replaceAll('http://', ''); + const data = await createNewPlatform({ community: community?.id, name: 'discourse', metadata: { - id: url.replaceAll('https://', '').replaceAll('http://', ''), + id: cleanedUrl, period: new Date( new Date().setDate(new Date().getDate() - 90) ).toISOString(), @@ -264,7 +267,7 @@ function TcDiscourse({ />