Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
mehdi-torabiv committed Oct 16, 2024
1 parent 2c8be2d commit 6cb4a51
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand Down Expand Up @@ -264,7 +267,7 @@ function TcDiscourse({
/>
<TcButton
className='w-1/3'
text='Confirm'
text={isCreatePlatformLoading ? 'Confirming...' : 'Confirm'}
variant='contained'
disabled={!!urlError || !url || isCreatePlatformLoading}
onClick={handleCreateNewPlatform}
Expand Down

0 comments on commit 6cb4a51

Please sign in to comment.