🐛 Parse valid publicId even though the prefix is empty
This commit is contained in:
@@ -55,7 +55,7 @@ const Expression = ({
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
case 'Empty':
|
case 'Empty':
|
||||||
return <Text>Reset {variableName}</Text>
|
return <Text as="span">Reset {variableName}</Text>
|
||||||
case 'Random ID':
|
case 'Random ID':
|
||||||
case 'Today':
|
case 'Today':
|
||||||
case 'Now':
|
case 'Now':
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
import { toKebabCase } from '@/helpers/toKebabCase'
|
import { toKebabCase } from '@/helpers/toKebabCase'
|
||||||
|
|
||||||
export const parseDefaultPublicId = (name: string, id: string) =>
|
export const parseDefaultPublicId = (name: string, id: string) => {
|
||||||
toKebabCase(name) + `-${id?.slice(-7)}`
|
const prefix = toKebabCase(name)
|
||||||
|
return `${prefix !== '' ? `${prefix}-` : ''}${id?.slice(-7)}`
|
||||||
|
}
|
||||||
|
|||||||
@@ -147,7 +147,7 @@ export const updateTypebot = authenticatedProcedure
|
|||||||
resultsTablePreferences: typebot.resultsTablePreferences ?? undefined,
|
resultsTablePreferences: typebot.resultsTablePreferences ?? undefined,
|
||||||
publicId: typebot.publicId ?? undefined,
|
publicId: typebot.publicId ?? undefined,
|
||||||
customDomain: typebot.customDomain ?? undefined,
|
customDomain: typebot.customDomain ?? undefined,
|
||||||
isClosed: typebot.isClosed ?? false,
|
isClosed: typebot.isClosed,
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user