Skip to content

Commit

Permalink
🐛 Parse valid publicId even though the prefix is empty
Browse files Browse the repository at this point in the history
  • Loading branch information
baptisteArno committed Aug 17, 2023
1 parent 9cfca38 commit a4ba9a8
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ const Expression = ({
)
}
case 'Empty':
return <Text>Reset {variableName}</Text>
return <Text as="span">Reset {variableName}</Text>
case 'Random ID':
case 'Today':
case 'Now':
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import { toKebabCase } from '@/helpers/toKebabCase'

export const parseDefaultPublicId = (name: string, id: string) =>
toKebabCase(name) + `-${id?.slice(-7)}`
export const parseDefaultPublicId = (name: string, id: string) => {
const prefix = toKebabCase(name)
return `${prefix !== '' ? `${prefix}-` : ''}${id?.slice(-7)}`
}
2 changes: 1 addition & 1 deletion apps/builder/src/features/typebot/api/updateTypebot.ts
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ export const updateTypebot = authenticatedProcedure
resultsTablePreferences: typebot.resultsTablePreferences ?? undefined,
publicId: typebot.publicId ?? undefined,
customDomain: typebot.customDomain ?? undefined,
isClosed: typebot.isClosed ?? false,
isClosed: typebot.isClosed,
},
})

Expand Down

0 comments on commit a4ba9a8

Please sign in to comment.