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({ />